mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [
git repo
]
Loading...
Searching...
No Matches
templateBLAS_test.cpp
1
#include "../../catch2/catch.hpp"
2
3
#include "../../../include/math/templateBLAS.hpp"
4
5
SCENARIO(
"testing scal"
,
"[templateBLAS]"
)
6
{
7
GIVEN(
"a precision"
)
8
{
9
10
WHEN(
"precision is float"
)
11
{
12
int
N = 2;
13
float
alpha = 2.;
14
float
x[] = { 1., 2. };
15
int
incX = 1;
16
mx::math::scal
( N, alpha, x, incX );
17
REQUIRE( x[0] == 2.0 );
18
REQUIRE( x[1] == 4.0 );
19
}
20
21
WHEN(
"precision is double"
)
22
{
23
int
N = 2;
24
double
alpha = 2.;
25
double
x[] = { 1., 2. };
26
int
incX = 1;
27
mx::math::scal
( N, alpha, x, incX );
28
REQUIRE( x[0] == 2.0 );
29
REQUIRE( x[1] == 4.0 );
30
}
31
}
32
}
mx::math::scal
void scal(const int N, const dataT &alpha, dataT *X, const int incX)
Template wrapper for cblas xSCAL.
Definition
templateBLAS.hpp:61
tests
include
math
templateBLAS_test.cpp
Generated on Wed Jan 1 2025 23:00:43 for mxlib by
1.9.8