Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
001b8929
Commit
001b8929
authored
May 29, 2019
by
Keith Bledsoe
Browse files
transform C# style to lazyCamel.
parent
97fdeed9
Pipeline
#57743
passed with stages
in 13 minutes and 42 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixsparsegrids/CMakeLists.txt
View file @
001b8929
...
...
@@ -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
}
)
...
...
radixsparsegrids/sparse
_
grids.cc
→
radixsparsegrids/sparsegrids.cc
View file @
001b8929
#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
::
G
enerateQuadrature
()
void
SparseGrids
::
g
enerateQuadrature
()
{
mGrid
.
setDomainTransform
(
mA
.
data
(),
mB
.
data
());
mPoints
=
mGrid
.
getPoints
();
}
int
SparseGrids
::
G
etNumQuadPoints
()
const
int
SparseGrids
::
g
etNumQuadPoints
()
const
{
return
mGrid
.
getNumPoints
();
}
void
SparseGrids
::
S
etTransformAt
(
const
int
index
,
const
double
left
,
void
SparseGrids
::
s
etTransformAt
(
const
int
index
,
const
double
left
,
const
double
right
)
{
mA
[
index
]
=
left
;
mB
[
index
]
=
right
;
}
void
SparseGrids
::
S
etConstrainedTransformAt
(
void
SparseGrids
::
s
etConstrainedTransformAt
(
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
;
C
onstraints
c
;
c
onstraints
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
::
G
etQuadAbscissasAt
(
const
int
index
,
double
*
abscissas
)
const
{
void
SparseGrids
::
g
etQuadAbscissasAt
(
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
::
S
etOrdinatesAt
(
const
int
index
,
double
*
ordinates
)
{
void
SparseGrids
::
s
etOrdinatesAt
(
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
::
G
enerateSurrogate
()
{
void
SparseGrids
::
g
enerateSurrogate
()
{
mGrid
.
loadNeededPoints
(
mOutputValues
.
data
());
std
::
vector
<
double
>
().
swap
(
mOutputValues
);
}
void
SparseGrids
::
E
valuate
(
const
double
*
abscissas
,
double
*
ordinates
)
const
{
void
SparseGrids
::
e
valuate
(
const
double
*
abscissas
,
double
*
ordinates
)
const
{
radix_require
(
abscissas
!=
nullptr
);
radix_require
(
ordinates
!=
nullptr
);
if
(
mConstraints
.
size
()
==
0
)
...
...
radixsparsegrids/sparse
_
grids.cpp2f.xml
→
radixsparsegrids/sparsegrids.cpp2f.xml
View file @
001b8929
File moved
radixsparsegrids/sparse
_
grids.hh
→
radixsparsegrids/sparsegrids.hh
View file @
001b8929
...
...
@@ -23,18 +23,18 @@ class RADIX_PUBLIC SparseGrids
const
std
::
string
&
type_depth
,
const
std
::
string
&
type_oned_rule
);
~
SparseGrids
();
void
S
etTransformAt
(
const
int
index
,
const
double
left
,
const
double
right
);
void
S
etConstrainedTransformAt
(
const
int
num_inputs
,
const
int
*
input_indices
,
void
s
etTransformAt
(
const
int
index
,
const
double
left
,
const
double
right
);
void
s
etConstrainedTransformAt
(
const
int
num_inputs
,
const
int
*
input_indices
,
const
double
left
,
const
double
right
);
void
G
enerateQuadrature
();
int
G
etNumQuadPoints
()
const
;
void
G
etQuadAbscissasAt
(
const
int
index
,
double
*
abscissas
)
const
;
void
S
etOutputDimension
(
const
int
dim
);
void
S
etOrdinatesAt
(
const
int
index
,
double
*
ordinates
);
void
G
enerateSurrogate
();
void
E
valuate
(
const
double
*
abscissas
,
double
*
ordinates
)
const
;
void
g
enerateQuadrature
();
int
g
etNumQuadPoints
()
const
;
void
g
etQuadAbscissasAt
(
const
int
index
,
double
*
abscissas
)
const
;
void
s
etOutputDimension
(
const
int
dim
);
void
s
etOrdinatesAt
(
const
int
index
,
double
*
ordinates
);
void
g
enerateSurrogate
();
void
e
valuate
(
const
double
*
abscissas
,
double
*
ordinates
)
const
;
private:
struct
C
onstraints
{
struct
c
onstraints
{
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
<
C
onstraints
>
mConstraints
;
std
::
vector
<
c
onstraints
>
mConstraints
;
TasGrid
::
TasmanianSparseGrid
mGrid
;
double
*
mPoints
;
std
::
vector
<
double
>
mOutputValues
;
...
...
radixsparsegrids/sparse
_
grids_I.f90
→
radixsparsegrids/sparsegrids_I.f90
View file @
001b8929
File moved
radixsparsegrids/sparse
_
grids_M.f90
→
radixsparsegrids/sparsegrids_M.f90
View file @
001b8929
File moved
radixsparsegrids/sparse
_
grids
_
interface.cc
→
radixsparsegrids/sparsegridsinterface.cc
View file @
001b8929
...
...
@@ -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
)
->
S
etConstrainedTransformAt
(
*
num_inputs
,
input_indices
,
*
left
,
*
right
);
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
s
etConstrainedTransformAt
(
*
num_inputs
,
input_indices
,
*
left
,
*
right
);
}
void
RadixSparseGrids_SetTransformAt
(
void
*
RadixSparseGrids_ptr
,
int
*
index
,
double
*
left
,
double
*
right
)
{
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
S
etTransformAt
(
*
index
,
*
left
,
*
right
);
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
s
etTransformAt
(
*
index
,
*
left
,
*
right
);
}
void
RadixSparseGrids_GenerateQuadrature
(
void
*
RadixSparseGrids_ptr
)
{
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
G
enerateQuadrature
();
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
g
enerateQuadrature
();
}
int
RadixSparseGrids_GetNumQuadPoints
(
void
*
RadixSparseGrids_ptr
)
{
return
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
G
etNumQuadPoints
();
return
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
g
etNumQuadPoints
();
}
void
RadixSparseGrids_GetQuadAbscissasAt
(
void
*
RadixSparseGrids_ptr
,
int
*
index
,
double
*
abscissas
)
{
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
G
etQuadAbscissasAt
(
*
index
,
abscissas
);
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
g
etQuadAbscissasAt
(
*
index
,
abscissas
);
}
void
RadixSparseGrids_SetOrdinatesAt
(
void
*
RadixSparseGrids_ptr
,
int
*
index
,
double
*
ordinates
)
{
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
S
etOrdinatesAt
(
*
index
,
ordinates
);
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
s
etOrdinatesAt
(
*
index
,
ordinates
);
}
void
RadixSparseGrids_GenerateSurrogate
(
void
*
RadixSparseGrids_ptr
)
{
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
G
enerateSurrogate
();
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
g
enerateSurrogate
();
}
void
RadixSparseGrids_Evaluate
(
void
*
RadixSparseGrids_ptr
,
double
*
abscissas
,
double
*
ordinates
)
{
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
E
valuate
(
abscissas
,
ordinates
);
((
RadixSparseGrids
*
)
RadixSparseGrids_ptr
)
->
e
valuate
(
abscissas
,
ordinates
);
}
void
*
RadixSparseGrids_initialize
()
...
...
radixsparsegrids/sparse
_
grids
_
interface.hh
→
radixsparsegrids/sparsegridsinterface.hh
View file @
001b8929
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
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