Commit 001b8929 authored by Keith Bledsoe's avatar Keith Bledsoe
Browse files

transform C# style to lazyCamel.

parent 97fdeed9
Pipeline #57743 passed with stages
in 13 minutes and 42 seconds
......@@ -3,13 +3,13 @@ TRIBITS_SUBPACKAGE(sparsegrids)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
SET(CXXSRC
sparse_grids.cc
sparse_grids_interface.cc
sparsegrids.cc
sparsegridsinterface.cc
)
SET(CXXHDR
sparse_grids.hh
sparse_grids_interface.hh
sparsegrids.hh
sparsegridsinterface.hh
)
SET(CXXLIB ${SUBPACKAGE_FULLNAME})
......@@ -17,8 +17,8 @@ TRIBITS_ADD_LIBRARY(${CXXLIB} SOURCES ${CXXSRC} NOINSTALLHEADERS ${CXXHDR})
IF(${PROJECT_NAME}_ENABLE_Fortran AND NOT BUILD_SHARED_LIBS)
ADD_COMPILE_OPTIONS("-ffree-line-length-none")
SET(F90SRC
sparse_grids_I.f90
sparse_grids_M.f90
sparsegrids_I.f90
sparsegrids_M.f90
)
SET(F90LIB ${SUBPACKAGE_FULLNAME}_F90)
TRIBITS_ADD_LIBRARY(${F90LIB} SOURCES ${F90SRC})
......
#include "radixsparsegrids/sparse_grids.hh"
#include "radixsparsegrids/sparsegrids.hh"
#include "radixbug/bug.hh"
namespace radix {
......@@ -70,32 +70,32 @@ SparseGrids::~SparseGrids()
if (mPoints != nullptr) {delete[] mPoints;}
}
void SparseGrids::GenerateQuadrature()
void SparseGrids::generateQuadrature()
{
mGrid.setDomainTransform(mA.data(), mB.data());
mPoints = mGrid.getPoints();
}
int SparseGrids::GetNumQuadPoints() const
int SparseGrids::getNumQuadPoints() const
{
return mGrid.getNumPoints();
}
void SparseGrids::SetTransformAt(const int index, const double left,
void SparseGrids::setTransformAt(const int index, const double left,
const double right)
{
mA[index] = left;
mB[index] = right;
}
void SparseGrids::SetConstrainedTransformAt(
void SparseGrids::setConstrainedTransformAt(
const int num_inputs, const int* input_indices, const double left, const double right)
{
radix_require(num_inputs > 1 && num_inputs <= mInputDimension);
radix_require(input_indices != nullptr);
int j = input_indices[0]-1;
Constraints c;
constraints c;
radix_require(j > -1 && j < mInputDimension);
radix_require(!mIsConstrained[j]);
mIsConstrained[j] = true;
......@@ -116,7 +116,7 @@ void SparseGrids::SetConstrainedTransformAt(
mConstraints.push_back(c);
}
void SparseGrids::GetQuadAbscissasAt(const int index, double* abscissas) const {
void SparseGrids::getQuadAbscissasAt(const int index, double* abscissas) const {
radix_require(index >= 0 && index < mGrid.getNumPoints());
radix_require(mPoints != nullptr);
radix_require(abscissas != nullptr);
......@@ -139,7 +139,7 @@ void SparseGrids::GetQuadAbscissasAt(const int index, double* abscissas) const {
}
}
void SparseGrids::SetOrdinatesAt(const int index, double* ordinates) {
void SparseGrids::setOrdinatesAt(const int index, double* ordinates) {
radix_require(index >= 0 && index < mGrid.getNumPoints());
radix_require(ordinates != nullptr);
for (int i = 0, j = index*mOutputDimension; i < mOutputDimension; ++i, ++j)
......@@ -148,12 +148,12 @@ void SparseGrids::SetOrdinatesAt(const int index, double* ordinates) {
}
}
void SparseGrids::GenerateSurrogate() {
void SparseGrids::generateSurrogate() {
mGrid.loadNeededPoints(mOutputValues.data());
std::vector<double>().swap(mOutputValues);
}
void SparseGrids::Evaluate(const double* abscissas, double* ordinates) const {
void SparseGrids::evaluate(const double* abscissas, double* ordinates) const {
radix_require(abscissas != nullptr);
radix_require(ordinates != nullptr);
if (mConstraints.size() == 0)
......
......@@ -23,18 +23,18 @@ class RADIX_PUBLIC SparseGrids
const std::string& type_depth,
const std::string& type_oned_rule);
~SparseGrids();
void SetTransformAt(const int index, const double left, const double right);
void SetConstrainedTransformAt(const int num_inputs, const int* input_indices,
void setTransformAt(const int index, const double left, const double right);
void setConstrainedTransformAt(const int num_inputs, const int* input_indices,
const double left, const double right);
void GenerateQuadrature();
int GetNumQuadPoints() const;
void GetQuadAbscissasAt(const int index, double* abscissas) const;
void SetOutputDimension(const int dim);
void SetOrdinatesAt(const int index, double* ordinates);
void GenerateSurrogate();
void Evaluate(const double* abscissas, double* ordinates) const;
void generateQuadrature();
int getNumQuadPoints() const;
void getQuadAbscissasAt(const int index, double* abscissas) const;
void setOutputDimension(const int dim);
void setOrdinatesAt(const int index, double* ordinates);
void generateSurrogate();
void evaluate(const double* abscissas, double* ordinates) const;
private:
struct Constraints {
struct constraints {
int base;
std::vector<int> others;
};
......@@ -44,7 +44,7 @@ class RADIX_PUBLIC SparseGrids
std::vector<double> mB;
mutable std::vector<double> mAbscissas;
std::vector<bool> mIsConstrained;
std::vector<Constraints> mConstraints;
std::vector<constraints> mConstraints;
TasGrid::TasmanianSparseGrid mGrid;
double* mPoints;
std::vector<double> mOutputValues;
......
......@@ -7,7 +7,7 @@
* with adjustment of the CIX xml file, please contact Robert A. Lefebvre, raq@ornl.gov
*/
#include <string.h>
#include "sparse_grids_interface.hh"
#include "sparsegridsinterface.hh"
void* RadixSparseGrids_Construct(int * input_dimension,int * output_dimension,int * depth,char* type_depth,char* type_1d_rule )
{
return new RadixSparseGrids(*input_dimension,*output_dimension,*depth,type_depth,type_1d_rule);
......@@ -15,42 +15,42 @@ void* RadixSparseGrids_Construct(int * input_dimension,int * output_dimension,in
void RadixSparseGrids_SetConstrainedTransformAt(void * RadixSparseGrids_ptr,int * num_inputs,int* input_indices,double * left,double * right)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->SetConstrainedTransformAt(*num_inputs,input_indices,*left,*right);
((RadixSparseGrids*)RadixSparseGrids_ptr)->setConstrainedTransformAt(*num_inputs,input_indices,*left,*right);
}
void RadixSparseGrids_SetTransformAt(void * RadixSparseGrids_ptr,int * index,double * left,double * right)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->SetTransformAt(*index,*left,*right);
((RadixSparseGrids*)RadixSparseGrids_ptr)->setTransformAt(*index,*left,*right);
}
void RadixSparseGrids_GenerateQuadrature(void * RadixSparseGrids_ptr)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->GenerateQuadrature();
((RadixSparseGrids*)RadixSparseGrids_ptr)->generateQuadrature();
}
int RadixSparseGrids_GetNumQuadPoints(void * RadixSparseGrids_ptr)
{
return ((RadixSparseGrids*)RadixSparseGrids_ptr)->GetNumQuadPoints();
return ((RadixSparseGrids*)RadixSparseGrids_ptr)->getNumQuadPoints();
}
void RadixSparseGrids_GetQuadAbscissasAt(void * RadixSparseGrids_ptr,int * index,double* abscissas)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->GetQuadAbscissasAt(*index,abscissas);
((RadixSparseGrids*)RadixSparseGrids_ptr)->getQuadAbscissasAt(*index,abscissas);
}
void RadixSparseGrids_SetOrdinatesAt(void * RadixSparseGrids_ptr,int * index,double* ordinates)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->SetOrdinatesAt(*index,ordinates);
((RadixSparseGrids*)RadixSparseGrids_ptr)->setOrdinatesAt(*index,ordinates);
}
void RadixSparseGrids_GenerateSurrogate(void * RadixSparseGrids_ptr)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->GenerateSurrogate();
((RadixSparseGrids*)RadixSparseGrids_ptr)->generateSurrogate();
}
void RadixSparseGrids_Evaluate(void * RadixSparseGrids_ptr,double* abscissas,double* ordinates)
{
((RadixSparseGrids*)RadixSparseGrids_ptr)->Evaluate(abscissas,ordinates);
((RadixSparseGrids*)RadixSparseGrids_ptr)->evaluate(abscissas,ordinates);
}
void* RadixSparseGrids_initialize()
......
......@@ -8,7 +8,7 @@
*/
#ifndef SPARSE_GRIDSINTERFACE_H
#define SPARSE_GRIDSINTERFACE_H
#include "radixsparsegrids/sparse_grids.hh"
#include "radixsparsegrids/sparsegrids.hh"
#include "radixcore/visibility.hh"
typedef radix::SparseGrids RadixSparseGrids;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment