-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bjodah/generate-weights
Added new C++11 function: generate_weights
- Loading branch information
Showing
8 changed files
with
10,649 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ dist/ | |
doc/ | ||
finitediff/_finitediff_templated.cpp | ||
*.egg-info | ||
tests/test_finitediff_templated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "finitediff_templated.hpp" | ||
#include <vector> | ||
#include <iostream> | ||
|
||
int main(){ | ||
std::vector<double> x {-1, 0, 1}; | ||
auto coeffs = finitediff::generate_weights(0.0, x, 2); | ||
std::cout << "Zeroth order: " << coeffs[0] << " " << coeffs[1] << " " << coeffs[2] << std::endl; | ||
std::cout << "First order: " << coeffs[3] << " " << coeffs[4] << " " << coeffs[5] << std::endl; | ||
std::cout << "Second order: " << coeffs[6] << " " << coeffs[7] << " " << coeffs[8] << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -std=c++11 -Wall -Wextra -Werror -Wpadded -pedantic -I../include -fno-omit-frame-pointer | ||
|
||
.PHONY: test debug clean | ||
|
||
test: test_finitediff_templated | ||
./test_finitediff_templated | ||
|
||
test_finitediff_templated: test_finitediff_templated.cpp ../include/finitediff_templated.hpp | ||
$(CXX) $(CXXFLAGS) -o $@ $< | ||
|
Oops, something went wrong.