Cosan  1.0
Data Analytics Library
Cosan::Test< NumericType, typename > Class Template Reference

Public Member Functions

 Test ()=default
 
 Test (vec< NumericType > &inputX)
 
 Test (vec< NumericType > inputX)
 

Public Attributes

NumericType a
 
vec< NumericTypeb
 
CosanMatrix< NumericTypeface
 

Private Member Functions

NumericType sumfunction (vec< NumericType > &a)
 

Detailed Description

template<typename NumericType, typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
class Cosan::Test< NumericType, typename >

Definition at line 51 of file templateTest.cpp.

Constructor & Destructor Documentation

◆ Test() [1/3]

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
Cosan::Test< NumericType, typename >::Test ( )
default

◆ Test() [2/3]

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
Cosan::Test< NumericType, typename >::Test ( vec< NumericType > &  inputX)
inline

Definition at line 54 of file templateTest.cpp.

54  {
55  static_assert(std::is_arithmetic<NumericType>::value, "NumericType must be numeric");
56  b = inputX;
57  a = sumfunction(b);
58  }

◆ Test() [3/3]

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
Cosan::Test< NumericType, typename >::Test ( vec< NumericType inputX)
inline

Definition at line 59 of file templateTest.cpp.

59  {
60  static_assert(std::is_arithmetic<NumericType>::value, "NumericType must be numeric");
61  b = inputX;
62  a = sumfunction(b);
63  }

Member Function Documentation

◆ sumfunction()

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
NumericType Cosan::Test< NumericType, typename >::sumfunction ( vec< NumericType > &  a)
inlineprivate

Definition at line 68 of file templateTest.cpp.

68  {
69  CosanMatrix<NumericType> X = Eigen::Map<const CosanMatrix<NumericType>>(a.data(), 1, a.size());
70  std::cout<<X<<std::endl;
71  return std::accumulate(a.begin(), a.end(), 0);
72  }

Member Data Documentation

◆ a

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
NumericType Cosan::Test< NumericType, typename >::a

Definition at line 64 of file templateTest.cpp.

◆ b

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
vec<NumericType> Cosan::Test< NumericType, typename >::b

Definition at line 65 of file templateTest.cpp.

◆ face

template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type>
CosanMatrix<NumericType> Cosan::Test< NumericType, typename >::face

Definition at line 66 of file templateTest.cpp.


The documentation for this class was generated from the following file:
Cosan::Test::a
NumericType a
Definition: templateTest.cpp:64
Cosan::Test::sumfunction
NumericType sumfunction(vec< NumericType > &a)
Definition: templateTest.cpp:68
Cosan::Test::b
vec< NumericType > b
Definition: templateTest.cpp:65