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
a341a511
Commit
a341a511
authored
13 years ago
by
Amaury Johnen
Browse files
Options
Downloads
Patches
Plain Diff
fix bug
parent
2991af1c
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
-5
14 additions, 5 deletions
Numeric/fullMatrix.h
with
14 additions
and
5 deletions
Numeric/fullMatrix.h
+
14
−
5
View file @
a341a511
...
@@ -20,24 +20,25 @@ class fullVector
...
@@ -20,24 +20,25 @@ class fullVector
private:
private:
int
_r
;
// size of the vector
int
_r
;
// size of the vector
scalar
*
_data
;
// pointer on the first element
scalar
*
_data
;
// pointer on the first element
bool
_own_data
;
friend
class
fullMatrix
<
scalar
>
;
friend
class
fullMatrix
<
scalar
>
;
public:
public:
// constructor and destructor
// constructor and destructor
fullVector
(
void
)
:
_r
(
0
),
_data
(
0
)
{}
fullVector
(
void
)
:
_r
(
0
),
_data
(
0
)
,
_own_data
(
1
)
{}
fullVector
(
int
r
)
:
_r
(
r
)
fullVector
(
int
r
)
:
_r
(
r
)
,
_own_data
(
1
)
{
{
_data
=
new
scalar
[
_r
];
_data
=
new
scalar
[
_r
];
setAll
(
0.
);
setAll
(
0.
);
}
}
fullVector
(
const
fullVector
<
scalar
>
&
other
)
:
_r
(
other
.
_r
)
fullVector
(
const
fullVector
<
scalar
>
&
other
)
:
_r
(
other
.
_r
)
,
_own_data
(
1
)
{
{
_data
=
new
scalar
[
_r
];
_data
=
new
scalar
[
_r
];
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
_data
[
i
]
=
other
.
_data
[
i
];
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
_data
[
i
]
=
other
.
_data
[
i
];
}
}
~
fullVector
()
~
fullVector
()
{
{
if
(
_data
)
delete
[]
_data
;
if
(
_own_data
&&
_data
)
delete
[]
_data
;
}
}
// get information (size, value)
// get information (size, value)
...
@@ -74,10 +75,18 @@ class fullVector
...
@@ -74,10 +75,18 @@ class fullVector
}
}
void
setAsProxy
(
const
fullVector
<
scalar
>
&
original
,
int
r_start
,
int
r
)
void
setAsProxy
(
const
fullVector
<
scalar
>
&
original
,
int
r_start
,
int
r
)
{
{
if
(
_data
)
delete
[]
_data
;
if
(
_own_data
&&
_data
)
delete
[]
_data
;
_own_data
=
false
;
_r
=
r
;
_r
=
r
;
_data
=
original
.
_data
+
r_start
;
_data
=
original
.
_data
+
r_start
;
}
}
void
setAsProxy
(
const
fullMatrix
<
scalar
>
&
original
,
int
c
)
{
if
(
_own_data
&&
_data
)
delete
[]
_data
;
_own_data
=
false
;
_r
=
original
.
_r
;
_data
=
original
.
_data
+
c
*
_r
;
}
inline
void
scale
(
const
scalar
s
)
inline
void
scale
(
const
scalar
s
)
{
{
if
(
s
==
0.
)
if
(
s
==
0.
)
...
...
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