Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MostafaMollaali
dynamic
Commits
f0c57790
Commit
f0c57790
authored
12 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
remove a function convertRowMajorSparsityToCRS() as it is not currently used
parent
acca112f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MathLib/LinAlg/Sparse/Sparsity.h
+1
-17
1 addition, 17 deletions
MathLib/LinAlg/Sparse/Sparsity.h
MathLib/LinAlg/Sparse/Sparsity.tpp
+0
-56
0 additions, 56 deletions
MathLib/LinAlg/Sparse/Sparsity.tpp
with
1 addition
and
73 deletions
MathLib/LinAlg/Sparse/Sparsity.h
+
1
−
17
View file @
f0c57790
...
...
@@ -24,22 +24,6 @@ namespace MathLib
*/
typedef
std
::
vector
<
std
::
set
<
std
::
size_t
>
>
RowMajorSparsity
;
/**
* convert a row-major sparsity to CRS data
*
* @tparam INTTYPE index type
* @param row_major_entries Row-major sparse pattern
* @param n_rows The number of rows
* @param row_ptr Pointer to row index
* @param col_idx Pointer to column index
* @param nonzero The number of non-zero entries
* @param data Pointer to non-zero values
*/
template
<
class
INTTYPE
>
void
convertRowMajorSparsityToCRS
(
const
RowMajorSparsity
&
row_major_entries
,
std
::
size_t
&
n_rows
,
INTTYPE
*
&
row_ptr
,
INTTYPE
*
&
col_idx
,
std
::
size_t
&
nonzero
,
double
*
&
data
);
}
// end namespace MathLib
#include
"Sparsity.tpp"
}
//MathLib
#endif // SPARSITY_H_
This diff is collapsed.
Click to expand it.
MathLib/LinAlg/Sparse/Sparsity.tpp
deleted
100644 → 0
+
0
−
56
View file @
acca112f
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*
* \file Sparsity.tpp
*
* Created on 2012-12-03 by Norihiro Watanabe
*/
#ifndef SPARSITY_TPP_
#define SPARSITY_TPP_
#include
<cassert>
namespace
MathLib
{
template
<
class
INTTYPE
>
void
convertRowMajorSparsityToCRS
(
const
RowMajorSparsity
&
row_major_entries
,
std
::
size_t
&
n_rows
,
INTTYPE
*
&
row_ptr
,
INTTYPE
*
&
col_idx
,
std
::
size_t
&
nonzero
,
double
*
&
data
)
{
n_rows
=
row_major_entries
.
size
();
assert
(
n_rows
>
0
);
if
(
n_rows
==
0
)
return
;
// get the number of nonzero entries and store the locations in the nonzero
// vector that start a row
nonzero
=
0
;
row_ptr
=
new
INTTYPE
[
n_rows
+
1
];
for
(
std
::
size_t
i
=
0
;
i
<
n_rows
;
i
++
)
{
row_ptr
[
i
]
=
nonzero
;
// starting point of the row
nonzero
+=
row_major_entries
[
i
].
size
();
// entries at the i th row
}
row_ptr
[
n_rows
]
=
nonzero
;
// store column indexes of nonzero entries
col_idx
=
new
INTTYPE
[
nonzero
];
size_t
cnt_entries
=
0
;
for
(
std
::
size_t
i
=
0
;
i
<
n_rows
;
i
++
)
{
const
std
::
set
<
std
::
size_t
>
&
setConnection
=
row_major_entries
[
i
];
for
(
std
::
set
<
std
::
size_t
>::
iterator
it
=
setConnection
.
begin
();
it
!=
setConnection
.
end
();
++
it
)
{
col_idx
[
cnt_entries
++
]
=
*
it
;
}
}
// allocate memory for nonzero entries
data
=
new
double
[
nonzero
];
for
(
std
::
size_t
i
=
0
;
i
<
nonzero
;
i
++
)
data
[
i
]
=
.0
;
}
}
// end namespace MathLib
#endif // SPARSITY_TPP_
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment