-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev_io_root' into dev_sim2root_merge
# Conflicts: # sim2root/Common/sim2root.py
- Loading branch information
Showing
31 changed files
with
2,084 additions
and
564 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Methods for filling the vectors from NumPy arrays | ||
|
||
template<typename Type> | ||
int fill_vec_1D(Type *arr, int *shape, vector<Type> *v) | ||
{ | ||
v->resize(shape[0]); | ||
for(int i=0; i<shape[0]; ++i) | ||
{ | ||
(*v)[i] = arr[i]; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
template<typename Type> | ||
int fill_vec_2D(Type *arr, int *shape, vector<vector<Type>> *v) | ||
{ | ||
v->resize(shape[0], vector<Type>(shape[1])); | ||
for(int i=0; i<shape[0]; ++i) | ||
{ | ||
for(int j=0; j<shape[1]; ++j) | ||
(*v)[i][j] = arr[i*shape[1]+j]; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
template<typename Type> | ||
int fill_vec_3D(Type *arr, int *shape, vector<vector<vector<Type>>> *v) | ||
{ | ||
v->resize(shape[0], vector<vector<Type>>(shape[1], vector<Type>(shape[2]))); | ||
for(int i=0; i<shape[0]; ++i) | ||
{ | ||
for(int j=0; j<shape[1]; ++j) | ||
{ | ||
for(int k=0; k<shape[2]; ++k) | ||
(*v)[i][j][k] = arr[i*shape[1]*shape[2]+j*shape[2]+k]; | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.1 | ||
1.0.2 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.