Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
phylo
fastcodeml
Commits
c3d6fe8a
Commit
c3d6fe8a
authored
Mar 26, 2015
by
Iakov Davydov
Browse files
remove trailing spaces from .cpp and .h files
parent
2589ab54
Changes
25
Hide whitespace changes
Inline
Side-by-side
BayesTest.cpp
View file @
c3d6fe8a
...
...
@@ -41,7 +41,7 @@ double BayesTest::getGridParams(const std::vector<double>& aVars, const std::vec
// Initialize the probability list. Only the fg branch needs to be set
mBEBset
.
initializeFgBranch
(
mForest
.
adjustFgBranchIdx
(
aFgBranch
));
// Calculating f(x_h|w)
// Calculating f(x_h|w)
// Order of site classes for iw or f(x_h|w):
// back fore #sets
// site class 0: w0 w0 10
...
...
@@ -62,13 +62,13 @@ double BayesTest::getGridParams(const std::vector<double>& aVars, const std::vec
omega_fg_is_one
=
omega_bg_is_one
=
true
;
}
else
if
(
iw
<
(
BEB_N1D
+
1
+
BEB_N1D
*
BEB_N1D
))
// class 2a: w0 w2
{
{
omega_bg
=
prior_params
[
2
][(
iw
-
BEB_N1D
-
1
)
/
BEB_N1D
];
omega_fg
=
prior_params
[
3
][(
iw
-
BEB_N1D
-
1
)
%
BEB_N1D
];
omega_fg_is_one
=
omega_bg_is_one
=
false
;
}
else
// class 2b: w1 w2
{
{
omega_bg
=
1.
;
omega_fg
=
prior_params
[
3
][
iw
-
BEB_N1D
-
1
-
BEB_N1D
*
BEB_N1D
];
omega_fg_is_one
=
false
;
omega_bg_is_one
=
true
;
...
...
@@ -89,7 +89,7 @@ double BayesTest::getGridParams(const std::vector<double>& aVars, const std::vec
q_fg
.
fillMatrix
(
omega_fg
,
kappa
);
q_fg
.
eigenQREV
();
}
}
#pragma omp section
{
if
(
omega_bg_is_one
)
...
...
@@ -171,10 +171,10 @@ void BayesTest::computeBEB(const std::vector<double>& aVars, size_t aFgBranch, c
// In the original code instead of BEB_DIMS there is nclassM. Both values are 4.
for
(
unsigned
int
codon_class
=
0
;
codon_class
<
BEB_DIMS
;
++
codon_class
)
{
// Given the point on the grid ip[] and codon_class, this returns iw and codon_class_proportion,
// where iw locates the correct f(x_h|w) stored in com.fhK[], and codon_class_proportion is
// Given the point on the grid ip[] and codon_class, this returns iw and codon_class_proportion,
// where iw locates the correct f(x_h|w) stored in com.fhK[], and codon_class_proportion is
// the proportion of the site class under the model.
// The BEB_N1D*BEB_N1D grid for p0-p1 is mapped onto the ternary graph for p0-p1-p2.
// The BEB_N1D*BEB_N1D grid for p0-p1 is mapped onto the ternary graph for p0-p1-p2.
//
unsigned
int
idx
;
switch
(
codon_class
)
...
...
@@ -326,7 +326,7 @@ void BayesTest::computeBEB(const std::vector<double>& aVars, size_t aFgBranch, c
// t is log of term on grid
double
t
=
log
(
fhk
[
codon_class
])
+
lnfXs
[
igrid
];
if
(
t
>
scale1
+
50
)
{
{
// Change scale factor scale1
for
(
unsigned
int
j
=
0
;
j
<
BEB_DIMS
;
++
j
)
mSiteClassProb
[
j
*
mNumSites
+
site
]
*=
exp
(
scale1
-
t
);
scale1
=
t
;
...
...
CodeMLoptimizer.cpp
View file @
c3d6fe8a
...
...
@@ -17,13 +17,13 @@ inline static double square(double a) {return a*a;}
inline
static
void
zero
(
double
x
[],
int
n
)
{
memset
(
x
,
0
,
n
*
sizeof
(
double
));}
inline
static
void
xtoy
(
const
double
x
[],
double
y
[],
int
n
)
{
memcpy
(
y
,
x
,
n
*
sizeof
(
double
));}
inline
static
void
identityMatrix
(
double
*
x
,
int
n
)
inline
static
void
identityMatrix
(
double
*
x
,
int
n
)
{
memset
(
x
,
0
,
n
*
n
*
sizeof
(
double
));
for
(
int
i
=
0
;
i
<
n
;
i
++
)
x
[
i
*
n
+
i
]
=
1.0
;
}
static
inline
double
norm
(
const
double
x
[],
int
n
)
static
inline
double
norm
(
const
double
x
[],
int
n
)
{
#ifdef USE_LAPACK
return
dnrm2_
(
&
n
,
x
,
&
I1
);
...
...
@@ -36,7 +36,7 @@ static inline double norm(const double x[], int n)
#endif
}
static
inline
double
innerp
(
const
double
x
[],
const
double
y
[],
int
n
)
static
inline
double
innerp
(
const
double
x
[],
const
double
y
[],
int
n
)
{
#ifdef USE_LAPACK
return
ddot_
(
&
n
,
x
,
&
I1
,
y
,
&
I1
);
...
...
@@ -49,7 +49,7 @@ static inline double innerp(const double x[], const double y[], int n)
#endif
}
static
inline
double
distance
(
const
double
*
RESTRICT
x
,
const
double
*
RESTRICT
y
,
int
n
)
static
inline
double
distance
(
const
double
*
RESTRICT
x
,
const
double
*
RESTRICT
y
,
int
n
)
{
double
t
=
0
;
...
...
CodonFrequencies.cpp
View file @
c3d6fe8a
...
...
@@ -107,7 +107,7 @@ void CodonFrequencies::updateCodonCount(const std::vector<std::vector<unsigned i
// Count again
size_t
cnt
=
aCodons
.
size
();
for
(
size_t
i
=
0
;
i
<
cnt
;
++
i
)
for
(
size_t
i
=
0
;
i
<
cnt
;
++
i
)
{
//if no ambiguities count as usual (add site multiplicity)
if
(
aCodons
[
i
].
size
()
==
2
)
...
...
DAGScheduler.cpp
View file @
c3d6fe8a
...
...
@@ -72,14 +72,14 @@ void DAGScheduler::dumpDAG(std::ostream& aOut) const
aOut
<<
std
::
hex
<<
*
ind
<<
' '
<<
std
::
setw
(
6
)
<<
v
<<
std
::
endl
;
}
aOut
<<
'#'
<<
std
::
endl
;
// Then output all edges
std
::
vector
<
std
::
pair
<
const
void
*
,
const
void
*>
>::
const_iterator
ied
=
mEdges
.
begin
();
for
(;
ied
!=
mEdges
.
end
();
++
ied
)
{
aOut
<<
ied
->
first
<<
' '
<<
ied
->
second
<<
std
::
endl
;
}
// For debug print the reference counts
std
::
map
<
const
void
*
,
int
>::
const_iterator
irc
=
mRefCounter
.
begin
();
for
(;
irc
!=
mRefCounter
.
end
();
++
irc
)
...
...
FatVectorTransform.cpp
View file @
c3d6fe8a
...
...
@@ -404,7 +404,7 @@ void FatVectorTransform::postCompact(CacheAlignedDoubleVector& aStepResults, Cac
}
}
// Reuse values
// Reuse values
VectorOfRangesNoCnt
::
const_iterator
icr
=
mReuseCmds
[
branch
].
begin
();
const
VectorOfRangesNoCnt
::
const_iterator
endr
=
mReuseCmds
[
branch
].
end
();
for
(;
icr
!=
endr
;
++
icr
)
...
...
Forest.cpp
View file @
c3d6fe8a
...
...
@@ -285,7 +285,7 @@ bool Forest::getBranchRange(const CmdLine& aCmdLine, size_t& aBranchStart, size_
else
if
(
aCmdLine
.
mBranchStart
<
UINT_MAX
&&
aCmdLine
.
mBranchStart
>=
num_branches
)
{
// Invalid start value, ignoring, do all branches
if
(
aCmdLine
.
mVerboseLevel
>=
VERBOSE_INFO_OUTPUT
)
std
::
cout
<<
std
::
endl
<<
"Invalid branch requested. Ignoring"
<<
std
::
endl
;
if
(
aCmdLine
.
mVerboseLevel
>=
VERBOSE_INFO_OUTPUT
)
std
::
cout
<<
std
::
endl
<<
"Invalid branch requested. Ignoring"
<<
std
::
endl
;
aBranchStart
=
0
;
aBranchEnd
=
num_branches
-
1
;
}
...
...
@@ -302,7 +302,7 @@ bool Forest::getBranchRange(const CmdLine& aCmdLine, size_t& aBranchStart, size_
aBranchStart
=
static_cast
<
size_t
>
(
aCmdLine
.
mBranchStart
);
if
(
aCmdLine
.
mBranchEnd
>=
num_branches
)
{
if
(
aCmdLine
.
mVerboseLevel
>=
VERBOSE_INFO_OUTPUT
)
std
::
cout
<<
std
::
endl
<<
"Invalid end branch requested. Ignoring"
<<
std
::
endl
;
if
(
aCmdLine
.
mVerboseLevel
>=
VERBOSE_INFO_OUTPUT
)
std
::
cout
<<
std
::
endl
<<
"Invalid end branch requested. Ignoring"
<<
std
::
endl
;
aBranchEnd
=
num_branches
-
1
;
if
(
aBranchStart
>
0
)
do_all
=
false
;
}
...
...
@@ -622,7 +622,7 @@ void Forest::addAggressiveReduction(ForestNode* aNode)
#ifdef NON_RECURSIVE_VISIT
void
Forest
::
prepareNonRecursiveVisit
(
void
)
{
// Clean the list for non-recursive visit to the trees. Clear also the list of respective parents
...
...
@@ -673,7 +673,7 @@ void Forest::prepareNonRecursiveVisitWalker(ForestNode* aNode, ForestNode* aPare
// Store the nodes in the visit order except the root that should not be visited
// Store also the respective parent node
if
(
aParentNode
)
{
{
aVisitList
.
push_back
(
aNode
);
aParentList
.
push_back
(
aParentNode
);
}
...
...
Genes.cpp
View file @
c3d6fe8a
...
...
@@ -14,10 +14,10 @@
Genes
::~
Genes
()
{
mDnaSpecies
.
clear
();
mDnaGene
.
clear
();
mSiteMultiplicity
.
clear
();
mMapSiteToDnaGene
.
clear
();
mDnaSpecies
.
clear
();
mDnaGene
.
clear
();
mSiteMultiplicity
.
clear
();
mMapSiteToDnaGene
.
clear
();
mMapSpecieToDnaGene
.
clear
();
mSitesMappingToOriginal
.
clear
();
mMapCodonToPosition
.
clear
();
...
...
@@ -186,7 +186,7 @@ void Genes::readFile(const char* aFilename, bool aCleanData)
}
// It is a gap if the codon is completely ambiguous
if
(
len
<
61
)
break
;
if
(
len
<
61
)
break
;
}
if
(
i
==
nspecies
)
{
...
...
@@ -241,7 +241,7 @@ void Genes::readFile(const char* aFilename, bool aCleanData)
std
::
cout
<<
"Num. species: "
<<
std
::
setw
(
6
)
<<
nspecies
<<
std
::
endl
;
std
::
cout
<<
"Num. basis: "
<<
std
::
setw
(
6
)
<<
nbasis
<<
std
::
endl
;
std
::
cout
<<
"Valid codons: "
<<
std
::
setw
(
6
)
<<
valid_codons
<<
"/"
<<
ncodons
<<
std
::
endl
;
if
(
num_ambiguous
)
std
::
cout
if
(
num_ambiguous
)
std
::
cout
<<
"Ambiguous: "
<<
std
::
setw
(
6
)
<<
num_ambiguous
<<
"/"
<<
ncodons
<<
std
::
endl
;
if
(
num_gaps
)
std
::
cout
<<
"Gaps removed: "
<<
std
::
setw
(
6
)
<<
num_gaps
<<
std
::
endl
;
...
...
@@ -402,9 +402,9 @@ void Genes::initFullCodonMap(void)
for
(
k
=
1
;
k
<
16
;
++
k
)
{
// Build one of the possible codons (valid and ambiguous)
codona
[
0
]
=
amb
[
i
];
codona
[
1
]
=
amb
[
j
];
codona
[
2
]
=
amb
[
k
];
codona
[
0
]
=
amb
[
i
];
codona
[
1
]
=
amb
[
j
];
codona
[
2
]
=
amb
[
k
];
std
::
vector
<
int
>
pos
;
bool
valid
=
false
;
...
...
HighLevelCoordinator.cpp
View file @
c3d6fe8a
...
...
@@ -142,7 +142,7 @@ struct HighLevelCoordinator::WorkTable
/// @param[in] aOut The stream on which the print should be done.
///
void
printVariables
(
size_t
aBranch
,
unsigned
int
aHyp
,
std
::
ostream
&
aOut
=
std
::
cout
)
const
;
/// Mark as job to be skipped branches outside the given range
///
/// @param[in] aBranchStart The first branch to be processed
...
...
@@ -282,7 +282,7 @@ void HighLevelCoordinator::WorkTable::checkAllJobsDone(void) const
any_error
=
true
;
}
}
if
(
any_error
)
{
std
::
cout
<<
std
::
endl
;
throw
FastCodeMLFatal
();}
}
...
...
@@ -327,7 +327,7 @@ void HighLevelCoordinator::WorkTable::printVariables(size_t aBranch, unsigned in
unsigned
int
count_per_line
=
0
;
static
const
std
::
streamsize
VARS_PRECISION
=
7
;
static
const
std
::
streamsize
VARS_WIDTH
=
11
;
// Write the data with uniform precision
std
::
streamsize
prec
=
aOut
.
precision
(
VARS_PRECISION
);
aOut
.
setf
(
std
::
ios
::
fixed
,
std
::
ios
::
floatfield
);
...
...
@@ -784,7 +784,7 @@ void HighLevelCoordinator::doWorker(Forest& aForest, const CmdLine& aCmdLine)
// Initialize the two hypothesis
BranchSiteModelNullHyp
h0
(
aForest
,
aCmdLine
);
BranchSiteModelAltHyp
h1
(
aForest
,
aCmdLine
);
// Initialize the BEB (no verbose at all)
BayesTest
beb
(
aForest
,
0
,
aCmdLine
.
mDoNotReduceForest
);
...
...
@@ -846,7 +846,7 @@ void HighLevelCoordinator::doWorker(Forest& aForest, const CmdLine& aCmdLine)
// Compute H0
double
lnl
=
h0
(
static_cast
<
size_t
>
(
job
[
1
]),
aCmdLine
.
mStopIfNotLRT
&&
job
[
2
]
>
0
,
threshold
);
// Assemble the results to be passed to the master
h0
.
getVariables
(
values_double
);
values_double
.
push_back
(
lnl
);
...
...
ParseParameters.cpp
View file @
c3d6fe8a
...
...
@@ -48,7 +48,7 @@ void ParseParameters::addParameter(const char* aParamValuePair)
mDictionary
[
name
]
=
atof
(
p
+
1
);
}
double
ParseParameters
::
getParameter
(
const
char
*
aParamName
)
const
{
// The name should exist in the dictionary
...
...
Phylip.cpp
View file @
c3d6fe8a
...
...
@@ -107,7 +107,7 @@ void Phylip::loadData(const char* aFilename, std::vector<std::string>& aSpecies,
throw
FastCodeMLFatal
(
o
);
}
}
// Other sanity checks
if
(
nbasis
%
3
)
{
...
...
PhyloTree.cpp
View file @
c3d6fe8a
...
...
@@ -100,8 +100,8 @@ unsigned int PhyloTree::cloneTree(ForestNode* aForestNode, unsigned int aTreeId,
// Set the pointers (best). The sequence is: Branch -> Site -> Set -> 1:N
for
(
int
i
=
0
;
i
<
Nt
;
++
i
)
{
//aForestNode->mProb[i] = &aProbVectors[VECTOR_SLOT*(aNumSites*Nt*id+aNumSites*i+aTreeId)];
aForestNode
->
mProb
[
i
]
=
&
aProbVectors
[
VECTOR_SLOT
*
(
aNumSites
*
Nt
*
id
+
aTreeId
*
Nt
+
i
)];
//aForestNode->mProb[i] = &aProbVectors[VECTOR_SLOT*(aNumSites*Nt*id+aNumSites*i+aTreeId)];
aForestNode
->
mProb
[
i
]
=
&
aProbVectors
[
VECTOR_SLOT
*
(
aNumSites
*
Nt
*
id
+
aTreeId
*
Nt
+
i
)];
}
#endif
...
...
ProbabilityMatrixSet.cpp
View file @
c3d6fe8a
...
...
@@ -86,7 +86,7 @@ const double** ProbabilityMatrixSetH0::getChangedMatrices(size_t aBranch)
return
mMatricesPtr
;
}
void
ProbabilityMatrixSetH0
::
setMatrices
(
size_t
aBranch
,
const
double
**
aMatricesPtr
)
{
memcpy
(
&
mMatrixSpace
[
0
*
mNumMatrices
*
MATRIX_SLOT
+
aBranch
*
MATRIX_SLOT
],
aMatricesPtr
[
0
],
N
*
N
*
sizeof
(
double
));
...
...
TransitionMatrix.cpp
View file @
c3d6fe8a
...
...
@@ -368,7 +368,7 @@ void TransitionMatrix::eigenRealSymm(double* aU, int aDim, double* aR, double* /
{
work
=
new
double
[
lwork
];
//std::cout << "Optimal work: " << lwork << " (" << lfwork << ")" << std::endl;
}
if
(
liwork
>
lfiwork
)
{
...
...
TreeAndSetsDependencies.cpp
View file @
c3d6fe8a
...
...
@@ -97,7 +97,7 @@ void TreeAndSetsDependencies::computeDependencies(unsigned int aNumSets, bool aN
// Number of dependencies classes
size_t
nc
=
tree_groups_dependencies
.
size
();
// One dependency classes
std
::
vector
<
unsigned
int
>
one_class
;
...
...
TreeAndSetsDependencies.h
View file @
c3d6fe8a
...
...
@@ -2,7 +2,7 @@
#ifndef TREEANDSETSDEPENDENCIES_H
#define TREEANDSETSDEPENDENCIES_H
/// List (each list depends on the previous) of list (sites to be executed in parallel) of pairs (site, site class) stored as site*4+site_class
/// List (each list depends on the previous) of list (sites to be executed in parallel) of pairs (site, site class) stored as site*4+site_class
typedef
std
::
vector
<
std
::
vector
<
unsigned
int
>
>
ListDependencies
;
#include
"Forest.h"
...
...
WriteResults.cpp
View file @
c3d6fe8a
...
...
@@ -42,7 +42,7 @@ void WriteResults::outputResults(void)
}
// Write the log-likelihood values (if a value is not present, write NA)
for
(
size_t
branch
=
min_branch
;
branch
<=
max_branch
;
++
branch
)
{
...
...
@@ -57,7 +57,7 @@ void WriteResults::outputResults(void)
else
{
out
<<
std
::
setw
(
22
)
<<
std
::
setprecision
(
15
)
<<
std
::
fixed
<<
im
->
second
;
ims
=
mParamStr
[
0
].
find
(
branch
);
// This output does not work on BG/Q.
//out << std::endl<< std::fixed <<"Branch lengths:" << ims->second << std::endl;
...
...
blas.h
View file @
c3d6fe8a
...
...
@@ -38,7 +38,7 @@
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
/// DSYRK performs one of the symmetric rank k operations
...
...
@@ -297,15 +297,15 @@ double ddot_(const int *n,
/// Computes the Euclidean norm of a vector.
///
///
/// DNRM2 computes the Euclidean (L2) norm of a double precision real vector
///
/// @param[in] n Number of elements in the operand vector.
/// @param[in] dx Array of dimension (n-1) * |incx| + 1. Array x contains the operand vector.
/// @param[in] incx Increment between elements of x.
///
///
/// @return Resulting Euclidean norm.
///
///
double
dnrm2_
(
const
int
*
n
,
const
double
*
dx
,
const
int
*
incx
);
...
...
fast.cpp
View file @
c3d6fe8a
...
...
@@ -114,7 +114,7 @@ int main(int aRgc, char **aRgv)
// Write out command line parameters (if not quiet i.e. if verbose level > 0)
if
(
cmd
.
mVerboseLevel
>=
VERBOSE_INFO_OUTPUT
)
{
std
::
cout
<<
"------------------------------------"
<<
std
::
endl
;
std
::
cout
<<
"FastCodeML V"
<<
version
<<
std
::
endl
;
std
::
cout
<<
"------------------------------------"
<<
std
::
endl
;
...
...
lapack.h
View file @
c3d6fe8a
...
...
@@ -126,7 +126,7 @@
/// returns this value as the first entry of the IWORK array, and
/// no error message related to LIWORK is issued by XERBLA.
///
/// @param[out] info
/// @param[out] info
/// = 0: successful exit
/// < 0: if INFO = -i, the i-th argument had an illegal value
/// > 0: Internal error
...
...
@@ -158,31 +158,31 @@ extern "C" void dsyevr_(const char *jobz,
/// DSYEVD computes all eigenvalues and, optionally, eigenvectors of a
/// real symmetric matrix A. If eigenvectors are desired, it uses a
/// divide and conquer algorithm.
///
///
/// The divide and conquer algorithm makes very mild assumptions about
/// floating point arithmetic. It will work on machines with a guard
/// digit in add/subtract, or on those binary machines without guard
/// digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
/// Cray-2. It could conceivably fail on hexadecimal or decimal machines
/// without guard digits, but we know of none.
///
///
/// Because of large use of BLAS of level 3, DSYEVD needs N**2 more
/// workspace than DSYEVX.
///
///
/// Arguments
/// =========
///
///
/// @param[in] jobz (input) CHARACTER*1
/// = 'N': Compute eigenvalues only;
/// = 'V': Compute eigenvalues and eigenvectors.
///
///
/// @param[in] uplo (input) CHARACTER*1
/// = 'U': Upper triangle of A is stored;
/// = 'L': Lower triangle of A is stored.
///
///
/// @param[in] n (input) INTEGER
/// The order of the matrix A. N >= 0.
///
///
/// @param[in,out] a (input/output) DOUBLE PRECISION array, dimension (LDA, N)
/// On entry, the symmetric matrix A. If UPLO = 'U', the
/// leading N-by-N upper triangular part of A contains the
...
...
@@ -194,16 +194,16 @@ extern "C" void dsyevr_(const char *jobz,
/// If JOBZ = 'N', then on exit the lower triangle (if UPLO='L')
/// or the upper triangle (if UPLO='U') of A, including the
/// diagonal, is destroyed.
///
///
/// @param[in] lda (input) INTEGER
/// The leading dimension of the array A. LDA >= max(1,N).
///
///
/// @param[out] w (output) DOUBLE PRECISION array, dimension (N)
/// If INFO = 0, the eigenvalues in ascending order.
///
///
/// @param[out] work (workspace/output) DOUBLE PRECISION array, dimension (LWORK)
/// On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
///
///
/// @param[in] lwork (input) INTEGER
/// The dimension of the array WORK.
/// If N <= 1, LWORK must be at least 1.
...
...
@@ -214,10 +214,10 @@ extern "C" void dsyevr_(const char *jobz,
/// arrays, returns these values as the first entries of the WORK
/// and IWORK arrays, and no error message related to LWORK or
/// LIWORK is issued by XERBLA.
///
///
/// @param[out] iwork (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))
/// On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
///
///
/// @param[in] liwork (input) INTEGER
/// The dimension of the array IWORK.
/// If N <= 1, LIWORK must be at least 1.
...
...
@@ -228,7 +228,7 @@ extern "C" void dsyevr_(const char *jobz,
/// IWORK arrays, returns these values as the first entries of
/// the WORK and IWORK arrays, and no error message related to
/// LWORK or LIWORK is issued by XERBLA.
///
///
/// @param[out] info (output) INTEGER
/// = 0: successful exit
/// < 0: if INFO = -i, the i-th argument had an illegal value
...
...
@@ -239,7 +239,7 @@ extern "C" void dsyevr_(const char *jobz,
/// to compute an eigenvalue while working on the submatrix
/// lying in rows and columns INFO/(N+1) through
/// mod(INFO,N+1).
///
///
extern
"C"
void
dsyevd_
(
const
char
*
jobz
,
const
char
*
uplo
,
const
int
*
n
,
...
...
nlopt.h
View file @
c3d6fe8a
...
...
@@ -7,17 +7,17 @@
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef NLOPT_H
...
...
@@ -68,7 +68,7 @@ typedef void (*nlopt_mfunc)(unsigned m, double *result,
double
*
gradient
,
/* NULL if not needed */
void
*
func_data
);
/* A preconditioner, which preconditions v at x to return vpre.
/* A preconditioner, which preconditions v at x to return vpre.
(The meaning of "preconditioning" is algorithm-dependent.) */
typedef
void
(
*
nlopt_precond
)(
unsigned
n
,
const
double
*
x
,
const
double
*
v
,
double
*
vpre
,
void
*
data
);
...
...
@@ -76,10 +76,10 @@ typedef void (*nlopt_precond)(unsigned n, const double *x, const double *v,
typedef
enum
{
/* Naming conventions:
NLOPT_{G/L}{D/N}_*
= global/local derivative/no-derivative optimization,
respectively
NLOPT_{G/L}{D/N}_*
= global/local derivative/no-derivative optimization,
respectively
*_RAND algorithms involve some randomization.
*_NOSCAL algorithms are *not* scaled to a unit hypercube
...
...
@@ -197,9 +197,9 @@ NLOPT_EXTERN(nlopt_opt) nlopt_copy(const nlopt_opt opt);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_optimize
(
nlopt_opt
opt
,
double
*
x
,
double
*
opt_f
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_min_objective
(
nlopt_opt
opt
,
nlopt_func
f
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_min_objective
(
nlopt_opt
opt
,
nlopt_func
f
,
void
*
f_data
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_max_objective
(
nlopt_opt
opt
,
nlopt_func
f
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_max_objective
(
nlopt_opt
opt
,
nlopt_func
f
,
void
*
f_data
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_precond_min_objective
(
nlopt_opt
opt
,
nlopt_func
f
,
nlopt_precond
pre
,
void
*
f_data
);
...
...
@@ -210,12 +210,12 @@ NLOPT_EXTERN(unsigned) nlopt_get_dimension(const nlopt_opt opt);
/* constraints: */
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_lower_bounds
(
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_lower_bounds
(
nlopt_opt
opt
,
const
double
*
lb
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_lower_bounds1
(
nlopt_opt
opt
,
double
lb
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_get_lower_bounds
(
const
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_get_lower_bounds
(
const
nlopt_opt
opt
,
double
*
lb
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_upper_bounds
(
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_upper_bounds
(
nlopt_opt
opt
,
const
double
*
ub
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_upper_bounds1
(
nlopt_opt
opt
,
double
ub
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_get_upper_bounds
(
const
nlopt_opt
opt
,
...
...
@@ -278,7 +278,7 @@ NLOPT_EXTERN(int) nlopt_get_force_stop(const nlopt_opt opt);
/* more algorithm-specific parameters */
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_local_optimizer
(
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_local_optimizer
(
nlopt_opt
opt
,
const
nlopt_opt
local_opt
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_population
(
nlopt_opt
opt
,
unsigned
pop
);
...
...
@@ -287,12 +287,12 @@ NLOPT_EXTERN(unsigned) nlopt_get_population(const nlopt_opt opt);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_vector_storage
(
nlopt_opt
opt
,
unsigned
dim
);
NLOPT_EXTERN
(
unsigned
)
nlopt_get_vector_storage
(
const
nlopt_opt
opt
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_default_initial_step
(
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_default_initial_step
(
nlopt_opt
opt
,
const
double
*
x
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_initial_step
(
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_initial_step
(
nlopt_opt
opt
,
const
double
*
dx
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_set_initial_step1
(
nlopt_opt
opt
,
double
dx
);
NLOPT_EXTERN
(
nlopt_result
)
nlopt_get_initial_step
(
const
nlopt_opt
opt
,
NLOPT_EXTERN
(
nlopt_result
)
nlopt_get_initial_step
(
const
nlopt_opt
opt
,
const
double
*
x
,
double
*
dx
);
/* the following are functions mainly designed to be used internally
...
...
@@ -315,7 +315,7 @@ NLOPT_EXTERN(void) nlopt_set_munge(nlopt_opt opt,
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__==3 && __GNUC_MINOR__ > 0))
# define NLOPT_DEPRECATED __attribute__((deprecated))
#else
# define NLOPT_DEPRECATED
# define NLOPT_DEPRECATED
#endif
typedef
double
(
*
nlopt_func_old
)(
int
n
,
const
double
*
x
,
...
...
Prev
1
2
Next
Iakov Davydov
@idavydov
mentioned in commit
a2308fed
·
Dec 02, 2015
mentioned in commit
a2308fed
mentioned in commit a2308fedc2f7d54107f1dc2a851da6ec1fddc268
Toggle commit list
Iakov Davydov
@idavydov
mentioned in commit
f540ad6d
·
Dec 03, 2015
mentioned in commit
f540ad6d
mentioned in commit f540ad6d19c264cb254569a6af30158cf8810e17
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment