Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compressed_sensing
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
compressed_sensing
Commits
53704c96
Commit
53704c96
authored
6 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Add skeletal C++ framework
parent
5811c44c
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
CMakeLists.txt
+18
-0
18 additions, 0 deletions
CMakeLists.txt
cmake/shared_settings.cmake
+34
-0
34 additions, 0 deletions
cmake/shared_settings.cmake
main.cpp
+11
-0
11 additions, 0 deletions
main.cpp
vector.h
+18
-0
18 additions, 0 deletions
vector.h
with
82 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
53704c96
*.swp
*.swp
*.swo
*.swo
.DS_Store
.DS_Store
build
This diff is collapsed.
Click to expand it.
CMakeLists.txt
0 → 100644
+
18
−
0
View file @
53704c96
cmake_minimum_required
(
VERSION 3.13
)
# 3.13 is required for target_link_options
project
(
CompressedSensing CXX
)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE
"Release"
)
endif
()
message
(
STATUS
"Build type:
${
CMAKE_BUILD_TYPE
}
"
)
find_package
(
Eigen3 3.3 REQUIRED NO_MODULE
)
include
(
cmake/shared_settings.cmake
)
add_executable
(
compressed_sensing
main.cpp
vector.h
)
target_link_libraries
(
compressed_sensing shared_settings Eigen3::Eigen
)
target_compile_features
(
compressed_sensing PUBLIC cxx_std_17
)
This diff is collapsed.
Click to expand it.
cmake/shared_settings.cmake
0 → 100644
+
34
−
0
View file @
53704c96
# This file defines an interface library used to add common compile flags to all targets.
add_library
(
shared_settings INTERFACE
)
# Warning flags
target_compile_options
(
shared_settings INTERFACE
-Wall
-Wcast-align
-Wcast-qual
-Wextra
-Wundef
-Wuseless-cast
-Wzero-as-null-pointer-constant
-pedantic
)
# Speed flags
target_compile_options
(
shared_settings INTERFACE -march=native -ffast-math
)
# Build type for profile generation
target_compile_options
(
shared_settings INTERFACE $<$<CONFIG:ProfileGenerate>:
-fprofile-generate
-O3
-DNDEBUG
>
)
target_link_options
(
shared_settings INTERFACE $<$<CONFIG:ProfileGenerate>:-fprofile-generate>
)
# Build type for profile use
target_compile_options
(
shared_settings INTERFACE $<$<CONFIG:ProfileUse>:
-fprofile-use
-O3
-DNDEBUG
>
)
target_link_options
(
shared_settings INTERFACE $<$<CONFIG:ProfileUse>:-fprofile-use>
)
This diff is collapsed.
Click to expand it.
main.cpp
0 → 100644
+
11
−
0
View file @
53704c96
#include
<iostream>
#include
"vector.h"
using
namespace
cs
;
//--------------------------------------------------------------------------------------------------
int
main
()
{
Vector
<
double
>
x
=
Vector
<
double
>::
Random
(
5
);
std
::
cout
<<
x
<<
'\n'
;
return
0
;
}
This diff is collapsed.
Click to expand it.
vector.h
0 → 100644
+
18
−
0
View file @
53704c96
#ifndef FUNSIM_VECTOR_H
#define FUNSIM_VECTOR_H
#include
<Eigen/Core>
namespace
cs
{
//--------------------------------------------------------------------------------------------------
template
<
typename
T
>
using
Vector
=
Eigen
::
Matrix
<
T
,
Eigen
::
Dynamic
,
1
>
;
//--------------------------------------------------------------------------------------------------
template
<
typename
T
>
using
Matrix
=
Eigen
::
Matrix
<
T
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
;
}
#endif
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