Cosan  1.0
Data Analytics Library
CosanBO.h
Go to the documentation of this file.
1 /**
2  *@file CosanBO.h
3  *@author Xinyu Zhang
4  *@brief CosanBO
5  *@date 2021-04-10
6  */
7 
8 #ifndef __COSANBO_H_INCLUDED__
9 #define __COSANBO_H_INCLUDED__
10 #include <string>
11 #ifndef FMT_HEADER_ONLY
12 #define FMT_HEADER_ONLY
13 #include <fmt/format.h>
14 #endif
15 #include <gsl/gsl>
16 #include <type_traits>
17 #include <cosan/utils/utils.h>
18 #include <cosan/utils/Exceptions.h>
19 #include <random>
20 
21 
22 template<typename NumericType>
23 concept Numeric = std::is_arithmetic<NumericType>::value ;
24 
25 template <class T, class U>
26 concept Derived = std::is_base_of<U, T>::value;
27 
28 namespace Cosan
29 {
30 
31 // template<typename NumericType,
32 // typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type
33 // >
34 
35  /** Description: data structure for matrix. Will be used throughout the project. */
36  template<Numeric NumericType>
37  using CosanMatrix = Eigen::Matrix<NumericType, Eigen::Dynamic, Eigen::Dynamic> ;
38 
39 // template<typename NumericType,
40 // typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type
41 // >
42  /** Description: data structure for column vector. Will be used throughout the project. */
43  template<Numeric NumericType>
44  using CosanColVector = Eigen::Matrix<NumericType, Eigen::Dynamic, 1> ;
45 
46 // template<typename NumericType,
47 // typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type
48 // >
49 
50 /** Description: data structure for row vector. Will be used throughout the project. */
51  template<Numeric NumericType>
52  using CosanRowVector = Eigen::Matrix<NumericType, 1, Eigen::Dynamic> ;
53 
54 // typedef std::variant<CosanMatrix<unsigned int>, CosanMatrix<unsigned long>,
55 // CosanMatrix<unsigned long long>, >
56 
57  /**
58  * @brief Cosan Base Object
59  * @details: Description: Base object CosanBO which all other Cosan objects inherited from.
60  * */
61  class CosanBO
62  {
63  public:
64  /**
65  * @brief Default constructor.
66  **/
68  }
69 // virtual ~CosanBO();
70 // virtual CosanBO *Shallow_copy() const;
71 // virtual CosanBO *Deep_copy() const;
72 
73  /**
74  * @brief Get the name of the objects.
75  * @details Description: Get the name of the object. It should return "Abstract Object"
76  **/
77  virtual const std::string GetName() const {
78  return "Abstract Object";}
79 
80 // virtual bool SaveFile(const std::string &path ,const std::string & prefix = "");
81 // virtual bool LoadFile(const std::string &path);
82 // void PrintModel();
83 // virtual bool Equals(CosanBO* other, float accuracy = 0.0);
84 // virtual CosanBO* Clone();
85 
86  protected:
87  };
88 
89 }
90 
91 #endif
Cosan
Definition: CosanBO.h:29
utils.h
Numeric
concept Numeric
Definition: CosanBO.h:23
Cosan::CosanBO
Cosan Base Object.
Definition: CosanBO.h:62
Cosan::CosanBO::GetName
virtual const std::string GetName() const
Get the name of the objects.
Definition: CosanBO.h:77
Cosan::CosanMatrix
Eigen::Matrix< NumericType, Eigen::Dynamic, Eigen::Dynamic > CosanMatrix
Definition: CosanBO.h:37
Cosan::CosanBO::CosanBO
CosanBO()
Default constructor.
Definition: CosanBO.h:67
Cosan::CosanRowVector
Eigen::Matrix< NumericType, 1, Eigen::Dynamic > CosanRowVector
Definition: CosanBO.h:52
Cosan::CosanColVector
Eigen::Matrix< NumericType, Eigen::Dynamic, 1 > CosanColVector
Definition: CosanBO.h:44
Derived
concept Derived
Definition: CosanBO.h:26
Exceptions.h