MLPACK
1.0.8
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
mlpack
core
optimizers
lrsdp
lrsdp.hpp
Go to the documentation of this file.
1
23
#ifndef __MLPACK_CORE_OPTIMIZERS_LRSDP_LRSDP_HPP
24
#define __MLPACK_CORE_OPTIMIZERS_LRSDP_LRSDP_HPP
25
26
#include <
mlpack/core.hpp
>
27
#include <
mlpack/core/optimizers/aug_lagrangian/aug_lagrangian.hpp
>
28
29
namespace
mlpack {
30
namespace
optimization {
31
32
class
LRSDP
33
{
34
public
:
44
LRSDP
(
const
size_t
numConstraints,
45
const
arma::mat&
initialPoint
);
46
56
LRSDP
(
const
size_t
numConstraints,
57
const
arma::mat& initialPoint,
58
AugLagrangian<LRSDP>
& augLagrangian);
59
66
double
Optimize
(arma::mat& coordinates);
67
72
double
Evaluate
(
const
arma::mat& coordinates)
const
;
73
78
void
Gradient
(
const
arma::mat& coordinates, arma::mat& gradient)
const
;
79
83
double
EvaluateConstraint
(
const
size_t
index,
84
const
arma::mat& coordinates)
const
;
85
90
void
GradientConstraint
(
const
size_t
index,
91
const
arma::mat& coordinates,
92
arma::mat& gradient)
const
;
93
95
size_t
NumConstraints
()
const
{
return
b
.n_elem; }
96
98
const
arma::mat&
GetInitialPoint
();
99
101
const
arma::mat&
C
()
const
{
return
c
; }
103
arma::mat&
C
() {
return
c
; }
104
106
const
std::vector<arma::mat>&
A
()
const
{
return
a
; }
108
std::vector<arma::mat>&
A
() {
return
a
; }
109
111
const
arma::uvec&
AModes
()
const
{
return
aModes
; }
113
arma::uvec&
AModes
() {
return
aModes
; }
114
116
const
arma::vec&
B
()
const
{
return
b
; }
118
arma::vec&
B
() {
return
b
; }
119
121
const
AugLagrangian<LRSDP>
&
AugLag
()
const
{
return
augLag
; }
123
AugLagrangian<LRSDP>
&
AugLag
() {
return
augLag
; }
124
125
private
:
126
// Should probably use sparse matrices for some of these.
127
129
arma::mat
c
;
131
std::vector<arma::mat>
a
;
133
arma::vec
b
;
134
136
arma::uvec
aModes
;
137
139
arma::mat
initialPoint
;
140
142
AugLagrangian<LRSDP>
augLagInternal
;
143
145
AugLagrangian<LRSDP>
&
augLag
;
146
};
147
148
};
// namespace optimization
149
};
// namespace mlpack
150
151
// Include implementation.
152
#include "lrsdp_impl.hpp"
153
154
#endif
Generated by
1.8.3.1