本文整理汇总了C++中Bounds::getYMax方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds::getYMax方法的具体用法?C++ Bounds::getYMax怎么用?C++ Bounds::getYMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds
的用法示例。
在下文中一共展示了Bounds::getYMax方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateCovarianceSymMatrix
tmv::SymMatrix<double, tmv::FortranStyle|tmv::Upper> calculateCovarianceSymMatrix(
const SBProfile& sbp, const Bounds<int>& bounds, double dx)
{
// Calculate the required dimensions
int idim = 1 + bounds.getXMax() - bounds.getXMin();
int jdim = 1 + bounds.getYMax() - bounds.getYMin();
int covdim = idim * jdim;
int k, ell; // k and l are indices that refer to image pixel separation vectors in the
// correlation func.
double x_k, y_ell; // physical vector separations in the correlation func, dx * k etc.
tmv::SymMatrix<double, tmv::FortranStyle|tmv::Upper> cov = tmv::SymMatrix<
double, tmv::FortranStyle|tmv::Upper>(covdim);
for (int i=1; i<=covdim; i++){ // note that the Image indices use the FITS convention and
// start from 1!!
for (int j=i; j<=covdim; j++){
k = ((j - 1) / jdim) - ((i - 1) / idim); // using integer division rules here
ell = ((j - 1) % jdim) - ((i - 1) % idim);
x_k = double(k) * dx;
y_ell = double(ell) * dx;
Position<double> p = Position<double>(x_k, y_ell);
cov(i, j) = sbp.xValue(p); // fill in the upper triangle with the correct value
}
}
return cov;
}
示例2: MakeErrorMessage
std::string MakeErrorMessage(const int x, const int y, const Bounds<int> b)
{
std::ostringstream oss(" ");
bool found=false;
if (x<b.getXMin() || x>b.getXMax()) {
oss << "Attempt to access column number "<<x
<< ", range is "<<b.getXMin()<<" to "<<b.getXMax();
found = true;
}
if (y<b.getYMin() || y>b.getYMax()) {
if (found) oss << " and ";
oss << "Attempt to access row number "<<y
<< ", range is "<<b.getYMin()<<" to "<<b.getYMax();
found = true;
}
if (!found) return "Cannot find bounds violation ???";
else return oss.str();
}
示例3: calculateCovarianceMatrix
/*
* Covariance matrix calculation using the input SBProfile, the dimensions of the image for
* which a covariance matrix is desired (in the form of a Bounds), and a scale dx
*/
ImageAlloc<double> calculateCovarianceMatrix(
const SBProfile& sbp, const Bounds<int>& bounds, double dx)
{
// Calculate the required dimensions of the image for which a covariance matrix is needed
int idim = 1 + bounds.getXMax() - bounds.getXMin();
int jdim = 1 + bounds.getYMax() - bounds.getYMin();
int covdim = idim * jdim;
tmv::SymMatrix<double,
tmv::FortranStyle|tmv::Upper> symcov = calculateCovarianceSymMatrix(sbp, bounds, dx);
ImageAlloc<double> cov = ImageAlloc<double>(covdim, covdim, 0.);
for (int i=1; i<=covdim; i++){ // note that the Image indices use the FITS convention and
// start from 1!!
for (int j=i; j<=covdim; j++){
cov.setValue(i, j, symcov(i, j)); // fill in the upper triangle with the
// correct CorrFunc value
}
}
return cov;
}