| 159 | } |
| 160 | |
| 161 | bool SplineClass::build() { |
| 162 | if (Nconstraints == 4) { |
| 163 | std::vector<double> abcd = CoolProp::linsolve(A, B); |
| 164 | a = abcd[0]; |
| 165 | b = abcd[1]; |
| 166 | c = abcd[2]; |
| 167 | d = abcd[3]; |
| 168 | return true; |
| 169 | } else { |
| 170 | throw CoolProp::ValueError(format("Number of constraints[%d] is not equal to 4", Nconstraints)); |
| 171 | } |
| 172 | } |
| 173 | bool SplineClass::add_value_constraint(double x, double y) { |
| 174 | int i = Nconstraints; |
| 175 | if (i == 4) return false; |