Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
surfseg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
patmjen
surfseg
Commits
2dbe9c5f
Commit
2dbe9c5f
authored
Sep 10, 2019
by
Patrick M. Jensen
Browse files
Options
Downloads
Patches
Plain Diff
Subtract 1 from frozen vertex indices
Since MATLAB uses 1-indexing we need to adjust the indices.
parent
fe05ae05
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
surfseg/matlab/mex_surfcut_4d.cpp
+3
-0
3 additions, 0 deletions
surfseg/matlab/mex_surfcut_4d.cpp
with
3 additions
and
0 deletions
surfseg/matlab/mex_surfcut_4d.cpp
+
3
−
0
View file @
2dbe9c5f
...
...
@@ -2,6 +2,7 @@
#include
<thread>
#include
<memory>
#include
<cmath>
#include
<algorithm>
#include
"mex.h"
#include
"matrix.h"
...
...
@@ -60,6 +61,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
// TODO: This ends up doing unnecessary allocation, copying, and freeing. Check added overhead.
Volume
<
int
>
frozenVertVol
=
getCastVolumeChecked
<
int
>
(
prhs
[
7
],
"FrozenVertices"
);
frozenVerts
.
assign
(
frozenVertVol
.
data
.
get
(),
frozenVertVol
.
data
.
get
()
+
frozenVertVol
.
numElem
());
std
::
transform
(
frozenVerts
.
begin
(),
frozenVerts
.
end
(),
frozenVerts
.
begin
(),
[](
auto
x
)
{
return
x
-
1
;
});
// Subtract 1 since MATLAB uses 1-indexing
}
size_t
nverts
=
vertVol
.
nx
;
...
...
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