TVM  0.9.4
AnisotropicWeight.h
Go to the documentation of this file.
1 
3 #pragma once
4 
6 
7 #include <Eigen/Core>
8 
9 namespace tvm
10 {
11 
12 namespace requirements
13 {
14 
37 template<bool Lightweight = true>
38 class AnisotropicWeightBase : public abstract::SingleSolvingRequirement<Eigen::VectorXd, Lightweight>
39 {
40 public:
42  AnisotropicWeightBase() : abstract::SingleSolvingRequirement<Eigen::VectorXd, Lightweight>(Eigen::VectorXd(), true) {}
43 
45  AnisotropicWeightBase(const Eigen::VectorXd & w)
46  : abstract::SingleSolvingRequirement<Eigen::VectorXd, Lightweight>(w, false)
47  {
48  if((w.array() < 0).any())
49  throw std::runtime_error("weights must be non-negative.");
50  }
51 
53 };
54 
56 
57 } // namespace requirements
58 
59 } // namespace tvm
#define TVM_DEFINE_LW_NON_LW_CONVERSION_OPERATORS(className, T, L)
Definition: SingleSolvingRequirement.h:79
Definition: AnisotropicWeight.h:39
AnisotropicWeightBase()
Definition: AnisotropicWeight.h:42
AnisotropicWeightBase(const Eigen::VectorXd &w)
Definition: AnisotropicWeight.h:45
Definition: SingleSolvingRequirement.h:26
SingleSolvingRequirement(const Eigen::VectorXd &val, bool isDefault)
Definition: SingleSolvingRequirement.h:48
Definition: AffineExprDetail.h:95
Definition: Clock.h:12