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
5SCENARIO( "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}
void scal(const int N, const dataT &alpha, dataT *X, const int incX)
Template wrapper for cblas xSCAL.