Loading [MathJax]/extensions/tex2jax.js
PolyFEM
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
x
y
z
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Typedefs
b
c
d
e
f
g
h
l
m
n
o
p
q
s
t
v
Enumerations
Related Symbols
a
c
e
g
i
l
o
p
s
Files
File List
File Members
All
_
a
c
d
e
f
g
h
i
j
l
m
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
_
a
c
d
e
f
g
i
l
m
q
s
t
v
w
x
y
z
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
QuadraticPenaltyForm.cpp
Go to the documentation of this file.
1
#include "
QuadraticPenaltyForm.hpp
"
2
3
#include <
polyfem/utils/MatrixUtils.hpp
>
4
5
namespace
polyfem::solver
6
{
7
8
QuadraticPenaltyForm::QuadraticPenaltyForm
(
const
StiffnessMatrix
&A,
9
const
Eigen::MatrixXd &b,
10
const
double
weight)
11
: penalty_weight_(weight), A_(A), b_(b)
12
{
13
assert(A.rows() == b.rows());
14
15
AtA_
=
A_
.transpose() *
A_
;
16
Atb_
=
A_
.transpose() *
b_
;
17
}
8
QuadraticPenaltyForm::QuadraticPenaltyForm
(
const
StiffnessMatrix
&A, {
…
}
18
19
double
QuadraticPenaltyForm::value_unweighted
(
const
Eigen::VectorXd &
x
)
const
20
{
21
const
Eigen::VectorXd
val
=
A_
*
x
-
b_
;
22
return
val
.squaredNorm() / 2;
23
}
19
double
QuadraticPenaltyForm::value_unweighted
(
const
Eigen::VectorXd &
x
)
const
{
…
}
24
25
void
QuadraticPenaltyForm::first_derivative_unweighted
(
const
Eigen::VectorXd &
x
, Eigen::VectorXd &gradv)
const
26
{
27
gradv = (
AtA_
*
x
-
Atb_
);
28
}
25
void
QuadraticPenaltyForm::first_derivative_unweighted
(
const
Eigen::VectorXd &
x
, Eigen::VectorXd &gradv)
const
{
…
}
29
30
void
QuadraticPenaltyForm::second_derivative_unweighted
(
const
Eigen::VectorXd &
x
,
StiffnessMatrix
&hessian)
const
31
{
32
hessian =
AtA_
;
33
}
30
void
QuadraticPenaltyForm::second_derivative_unweighted
(
const
Eigen::VectorXd &
x
,
StiffnessMatrix
&hessian)
const
{
…
}
34
}
// namespace polyfem::solver
val
double val
Definition
Assembler.cpp:86
MatrixUtils.hpp
QuadraticPenaltyForm.hpp
x
int x
Definition
SplineBasis3d.cpp:55
polyfem::solver::QuadraticPenaltyForm::first_derivative_unweighted
void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override
Compute the first derivative of the value wrt x.
Definition
QuadraticPenaltyForm.cpp:25
polyfem::solver::QuadraticPenaltyForm::second_derivative_unweighted
void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override
Compute the second derivative of the value wrt x.
Definition
QuadraticPenaltyForm.cpp:30
polyfem::solver::QuadraticPenaltyForm::b_
Eigen::MatrixXd b_
Constraints value.
Definition
QuadraticPenaltyForm.hpp:42
polyfem::solver::QuadraticPenaltyForm::value_unweighted
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the value of the form.
Definition
QuadraticPenaltyForm.cpp:19
polyfem::solver::QuadraticPenaltyForm::A_
StiffnessMatrix A_
Constraints matrix.
Definition
QuadraticPenaltyForm.hpp:41
polyfem::solver::QuadraticPenaltyForm::AtA_
StiffnessMatrix AtA_
Definition
QuadraticPenaltyForm.hpp:44
polyfem::solver::QuadraticPenaltyForm::Atb_
Eigen::VectorXd Atb_
Definition
QuadraticPenaltyForm.hpp:45
polyfem::solver::QuadraticPenaltyForm::QuadraticPenaltyForm
QuadraticPenaltyForm(const StiffnessMatrix &A, const Eigen::MatrixXd &b, const double weight)
Construct a new QuadraticPenaltyForm object for the constraints Ax = b.
Definition
QuadraticPenaltyForm.cpp:8
polyfem::solver
Definition
OptState.hpp:16
polyfem::StiffnessMatrix
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition
Types.hpp:22
src
polyfem
solver
forms
QuadraticPenaltyForm.cpp
Generated by
1.9.8