WSL/SLF GitLab Repository
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
2f9d3084
Commit
2f9d3084
authored
Aug 24, 2012
by
Mathias Bavay
Browse files
Improved some error messages and improved consistency of error messages
parent
5a196216
Changes
5
Hide whitespace changes
Inline
Side-by-side
meteoio/Array1D.h
View file @
2f9d3084
...
...
@@ -183,7 +183,7 @@ template<class T> inline T& Array1D<T>::operator()(const unsigned int& index) {
if
(
index
>=
nx
)
{
std
::
stringstream
ss
;
ss
<<
"Trying to access array("
<<
index
<<
")"
;
ss
<<
" while array is
[
"
<<
nx
<<
"
]
"
;
ss
<<
" while array is
(
"
<<
nx
<<
"
)
"
;
throw
IndexOutOfBoundsException
(
ss
.
str
(),
AT
);
}
#endif
...
...
@@ -195,7 +195,7 @@ template<class T> inline const T Array1D<T>::operator()(const unsigned int& inde
if
(
index
>=
nx
)
{
std
::
stringstream
ss
;
ss
<<
"Trying to access array("
<<
index
<<
")"
;
ss
<<
" while array is
[
"
<<
nx
<<
"
]
"
;
ss
<<
" while array is
(
"
<<
nx
<<
"
)
"
;
throw
IndexOutOfBoundsException
(
ss
.
str
(),
AT
);
}
#endif
...
...
meteoio/Array2D.h
View file @
2f9d3084
...
...
@@ -232,7 +232,7 @@ template<class T> inline T& Array2D<T>::operator()(const unsigned int& x, const
if
((
x
>=
nx
)
||
(
y
>=
ny
))
{
std
::
stringstream
ss
;
ss
<<
"Trying to access array("
<<
x
<<
","
<<
y
<<
")"
;
ss
<<
" while array is
[
"
<<
nx
<<
","
<<
ny
<<
"
]
"
;
ss
<<
" while array is
(
"
<<
nx
<<
","
<<
ny
<<
"
)
"
;
throw
IndexOutOfBoundsException
(
ss
.
str
(),
AT
);
}
#endif
...
...
@@ -245,7 +245,7 @@ template<class T> inline const T Array2D<T>::operator()(const unsigned int& x, c
if
((
x
>=
nx
)
||
(
y
>=
ny
))
{
std
::
stringstream
ss
;
ss
<<
"Trying to access array("
<<
x
<<
","
<<
y
<<
")"
;
ss
<<
" while array is
[
"
<<
nx
<<
","
<<
ny
<<
"
]
"
;
ss
<<
" while array is
(
"
<<
nx
<<
","
<<
ny
<<
"
)
"
;
throw
IndexOutOfBoundsException
(
ss
.
str
(),
AT
);
}
#endif
...
...
meteoio/Array3D.h
View file @
2f9d3084
...
...
@@ -268,7 +268,7 @@ template<class T> inline T& Array3D<T>::operator()(const unsigned int& x, const
if
((
x
>=
nx
)
||
(
y
>=
ny
)
||
(
z
>=
nz
))
{
std
::
stringstream
ss
;
ss
<<
"Trying to access array("
<<
x
<<
","
<<
y
<<
","
<<
z
<<
")"
;
ss
<<
" while array is
[
"
<<
nx
<<
","
<<
ny
<<
","
<<
nz
<<
"
]
"
;
ss
<<
" while array is
(
"
<<
nx
<<
","
<<
ny
<<
","
<<
nz
<<
"
)
"
;
throw
IndexOutOfBoundsException
(
ss
.
str
(),
AT
);
}
#endif
...
...
@@ -282,7 +282,7 @@ template<class T> inline const T Array3D<T>::operator()(const unsigned int& x, c
if
((
x
>=
nx
)
||
(
y
>=
ny
)
||
(
z
>=
nz
))
{
std
::
stringstream
ss
;
ss
<<
"Trying to access array("
<<
x
<<
","
<<
y
<<
","
<<
z
<<
")"
;
ss
<<
" while array is
[
"
<<
nx
<<
","
<<
ny
<<
","
<<
nz
<<
"
]
"
;
ss
<<
" while array is
(
"
<<
nx
<<
","
<<
ny
<<
","
<<
nz
<<
"
)
"
;
throw
IndexOutOfBoundsException
(
ss
.
str
(),
AT
);
}
#endif
...
...
meteoio/Grid2DObject.cc
View file @
2f9d3084
...
...
@@ -214,7 +214,10 @@ void Grid2DObject::set(const unsigned int& i_ncols, const unsigned int& i_nrows,
{
//Test for equality in size: Only compatible Array2D<double> grids are permitted
if
((
i_ncols
!=
i_grid2D
.
getNx
())
||
(
i_nrows
!=
i_grid2D
.
getNy
()))
{
throw
IOException
(
"Mismatch in size of Array2D<double> parameter _grid2D and size of Grid2DObject"
,
AT
);
std
::
stringstream
ss
;
ss
<<
"Trying to initialize a ( "
<<
i_ncols
<<
" x "
<<
i_nrows
<<
" ) Grid2DObject with a "
;
ss
<<
"( "
<<
i_grid2D
.
getNx
()
<<
" x "
<<
i_grid2D
.
getNy
()
<<
" ) 2D array"
;
throw
IOException
(
ss
.
str
(),
AT
);
}
setValues
(
i_ncols
,
i_nrows
,
i_cellsize
,
i_llcorner
);
...
...
meteoio/Grid3DObject.cc
View file @
2f9d3084
...
...
@@ -232,7 +232,10 @@ void Grid3DObject::set(const unsigned int& i_ncols, const unsigned int& i_nrows,
{
//Test for equality in size: Only compatible Array3D<double> grids are permitted
if
((
i_ncols
!=
i_grid3D
.
getNx
())
||
(
i_nrows
!=
i_grid3D
.
getNy
())
||
(
i_ndepths
!=
i_grid3D
.
getNz
()))
{
throw
IOException
(
"Mismatch in size of Array3D<double> parameter grid3D and size of Grid3DObject"
,
AT
);
std
::
stringstream
ss
;
ss
<<
"Trying to initialize a ( "
<<
i_ncols
<<
" x "
<<
i_nrows
<<
" x "
<<
i_ndepths
<<
" ) Grid3DObject with a "
;
ss
<<
"( "
<<
i_grid3D
.
getNx
()
<<
" x "
<<
i_grid3D
.
getNy
()
<<
" x "
<<
i_grid3D
.
getNz
()
<<
" ) 3D array"
;
throw
IOException
(
ss
.
str
(),
AT
);
}
setValues
(
i_ncols
,
i_nrows
,
i_ndepths
,
i_cellsize
,
i_llcorner
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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