Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
2d750caf
Commit
2d750caf
authored
15 years ago
by
Éric Béchet
Browse files
Options
Downloads
Patches
Plain Diff
added resize function to fullMatrix
parent
a2f83ba6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Numeric/fullMatrix.h
+14
-0
14 additions, 0 deletions
Numeric/fullMatrix.h
with
14 additions
and
0 deletions
Numeric/fullMatrix.h
+
14
−
0
View file @
2d750caf
...
@@ -173,6 +173,20 @@ class fullMatrix
...
@@ -173,6 +173,20 @@ class fullMatrix
}
}
fullMatrix
()
:
_own_data
(
false
),
_r
(
0
),
_c
(
0
),
_data
(
0
)
{}
fullMatrix
()
:
_own_data
(
false
),
_r
(
0
),
_c
(
0
),
_data
(
0
)
{}
~
fullMatrix
()
{
if
(
_data
&&
_own_data
)
delete
[]
_data
;
}
~
fullMatrix
()
{
if
(
_data
&&
_own_data
)
delete
[]
_data
;
}
bool
resize
(
int
r
,
int
c
)
// data will be owned (same as constructor)
{
if
((
r
!=
_r
||
c
!=
_c
)
||
(
!
_own_data
))
{
_r
=
r
;
_c
=
c
;
if
((
_own_data
)
&&
(
_data
))
delete
[]
_data
;
_data
=
new
scalar
[
_r
*
_c
];
_own_data
=
true
;
return
true
;
}
return
false
;
// no reallocation
}
void
setAsProxy
(
fullMatrix
<
scalar
>
&
original
,
int
c_start
,
int
c
)
{
void
setAsProxy
(
fullMatrix
<
scalar
>
&
original
,
int
c_start
,
int
c
)
{
if
(
_data
&&
_own_data
)
if
(
_data
&&
_own_data
)
delete
[]
_data
;
delete
[]
_data
;
...
...
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