Minotaur 0.4.1
Docs for developers
Gradient.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2009 - 2025 The Minotaur Team.
5//
6
13#ifndef MINOTAURGRADIENT_H
14#define MINOTAURGRADIENT_H
15
16#include "linalg/Vector.h"
17#include "Variable.h"
18
19namespace Minotaur {
20
21 class Gradient {
22 public:
23 Gradient() {};
24
25 // only the following coordinates have non-zero components in the
26 // gradient.
27 //virtual VariableIterator varsBegin() { return vars_.begin(); }
28 //virtual VariableIterator varsEnd() { return vars_.end(); }
29
30 // initialize
31 virtual void initialize() {};
32
33 // get no. of nonzeros in the gradient vector
34 virtual UInt getNumNz() const {};
35
36 // evaluate gradient at x
37 virtual LinearAlgebra::ConstDoubleVectorPtr
38 eval(const std::vector<double> &x) const { assert(!"implement me!"); }
39
40 // evaluate gradient at x
41 virtual LinearAlgebra::ConstDoubleVectorPtr
42 eval (LinearAlgebra::ConstDoubleVectorPtr x) { assert(!"implement me!"); }
43 //virtual bool isZero() const { return true; }
44
45 protected:
46 // LinearGradientPtr lgrad_;
47 // QuadraticGradientPtr qgrad_;
48 };
49
50 typedef Gradient* GradientPtr;
51 typedef const Gradient* ConstGradientPtr;
52}
53#endif
54
Define the Variable class.
Definition: Gradient.h:21
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025