-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathskslc.tcc
33 lines (30 loc) · 899 Bytes
/
skslc.tcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* \file skslc.tcc
* Get a slice from antisymmetric matrix.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "colmaj.tcc"
template<typename T>
inline signed skslc(uplo_t uploA,
unsigned n,
unsigned i,
T *x,
T *_A, unsigned ldA)
{
colmaj<T> A(_A, ldA);
x[i] = 0.0;
switch (uploA) {
case BLIS_UPPER:
for (unsigned j = 0; j < i; ++j)
x[j] = A(j, i);
for (unsigned j = i+1; j < n; ++j)
x[j] = -A(i, j);
return 0;
default:
std::cerr << "SKSLC: Lower triangular storage not implemented. Sorry." << std::endl;
return err_info(Pfaffine_NOT_IMPLEMNTED, 0);
}
}