├── CppOptions
├── .gitignore
├── Makefile
├── .DS_Store
├── hist.hpp
├── GericDerivative.cpp
├── MonteCarlo.hpp
├── blas_samp.hpp
├── boosttest.hpp
├── c20test.hpp
├── stl_alg.hpp
├── LatticeModel.hpp
├── BlackScholesPricer.hpp
├── GericDerivative.h
├── qlibsample.hpp
├── hist.cpp
├── c20test.cpp
├── RungeKutta.hpp
├── Prototype.hpp
├── DataSource.hpp
├── Integration.hpp
├── BlackScholes.hpp
├── DesignPatterns.cpp
├── EulersMethod.hpp
├── RandomWalk.hpp
├── GenericOption.h
├── DesignPatterns.hpp
├── Functional.hpp
├── NewtonMethod.hpp
├── DateCompact.h
├── Dictionary.h
├── MathFunction.hpp
├── blas_samp.cpp
├── Matrix.h
├── DataSource.cpp
├── CDS.h
├── Prototype.cpp
├── RandomWalkGenerator.h
├── Observer.hpp
├── templates.hpp
├── LAVectors.hpp
├── EulersMethod.cpp
├── Date.h
├── OOExamples.cpp
├── RandomWalk.cpp
├── RungeKutta.cpp
├── templates.cpp
├── boosttest.cpp
├── Integration.cpp
├── OOExamples.h
├── MathFunction.cpp
├── RandomWalkGenerator.cpp
├── GenericOption.cpp
├── NewtonMethod.cpp
├── LAVectors.cpp
├── Dictionary.cpp
├── Observer.cpp
├── MonteCarlo.cpp
├── BlackScholesPricer.cpp
├── DateCompact.cpp
├── BlackScholes.cpp
├── mymod.py
├── Matrix.cpp
├── CDS.cpp
├── Functional.cpp
├── qlibsample.cpp
├── LatticeModel.cpp
├── Date.cpp
└── stl_alg.cpp
├── .gitattributes
├── Appendix A.pdf
├── 9781484263143.jpg
├── CppOptions.xcodeproj
├── xcuserdata
│ └── carlosoliveira.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── CppOptions.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── carlosoliveira.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── project.pbxproj
├── errata.md
├── README.md
├── Contributing.md
└── LICENSE.txt
/CppOptions/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/Appendix A.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Apress/options-derivatives-programming-cpp20/HEAD/Appendix A.pdf
--------------------------------------------------------------------------------
/CppOptions/Makefile:
--------------------------------------------------------------------------------
1 |
2 | CPPFLAGS=-std=c++2a
3 |
4 | DateCompact: Date.o
5 |
6 | clean: ; rm -f *.o
7 |
--------------------------------------------------------------------------------
/9781484263143.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Apress/options-derivatives-programming-cpp20/HEAD/9781484263143.jpg
--------------------------------------------------------------------------------
/CppOptions/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Apress/options-derivatives-programming-cpp20/HEAD/CppOptions/.DS_Store
--------------------------------------------------------------------------------
/CppOptions.xcodeproj/xcuserdata/carlosoliveira.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CppOptions.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CppOptions.xcodeproj/project.xcworkspace/xcuserdata/carlosoliveira.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Apress/options-derivatives-programming-cpp20/HEAD/CppOptions.xcodeproj/project.xcworkspace/xcuserdata/carlosoliveira.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CppOptions/hist.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // hist.hpp
3 | // CppOptions
4 | //
5 | // Created by Carlos Oliveira on 8/8/20.
6 | // Copyright © 2020 Carlos Oliveira. All rights reserved.
7 | //
8 |
9 | #ifndef hist_hpp
10 | #define hist_hpp
11 |
12 | #include
13 |
14 | #endif /* hist_hpp */
15 |
--------------------------------------------------------------------------------
/errata.md:
--------------------------------------------------------------------------------
1 | # Errata for *Options and Derivatives Programming in C++20*
2 |
3 | On **page xx** [Summary of error]:
4 |
5 | Details of error here. Highlight key pieces in **bold**.
6 |
7 | ***
8 |
9 | On **page xx** [Summary of error]:
10 |
11 | Details of error here. Highlight key pieces in **bold**.
12 |
13 | ***
--------------------------------------------------------------------------------
/CppOptions.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CppOptions/GericDerivative.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // GericDerivative.cpp
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #include "GericDerivative.h"
12 |
--------------------------------------------------------------------------------
/CppOptions/MonteCarlo.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // MonteCarlo.hpp
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #ifndef MonteCarlo_hpp
12 | #define MonteCarlo_hpp
13 |
14 |
15 |
16 |
17 | #endif /* MonteCarlo_hpp */
18 |
--------------------------------------------------------------------------------
/CppOptions/blas_samp.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // blas_samp.hpp
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #ifndef blas_samp_hpp
12 | #define blas_samp_hpp
13 |
14 | #include
15 |
16 | #endif /* blas_samp_hpp */
17 |
--------------------------------------------------------------------------------
/CppOptions/boosttest.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // boosttest.hpp
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #ifndef boosttest_hpp
12 | #define boosttest_hpp
13 |
14 | #include
15 |
16 | #endif /* boosttest_hpp */
17 |
--------------------------------------------------------------------------------
/CppOptions/c20test.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // c20test.hpp
3 | // CppOptions
4 | //
5 | // (c) 2020 Carlos Oliveira
6 | // This code is part of the book
7 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
8 | // by Carlos Oliveira, Apress, 2020.
9 | // For more information, visit http://coliveira.net
10 |
11 |
12 | #ifndef c20test_hpp
13 | #define c20test_hpp
14 |
15 | #include
16 |
17 | #endif /* c20test_hpp */
18 |
--------------------------------------------------------------------------------
/CppOptions/stl_alg.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // stl_alg.hpp
3 | // CppOptions
4 | //
5 | //
6 | // (c) 2020 Carlos Oliveira
7 | // This code is part of the book
8 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
9 | // by Carlos Oliveira, Apress, 2020.
10 | // For more information, visit http://coliveira.net
11 |
12 | #ifndef stl_alg_hpp
13 | #define stl_alg_hpp
14 |
15 | #include
16 |
17 | #endif /* stl_alg_hpp */
18 |
--------------------------------------------------------------------------------
/CppOptions/LatticeModel.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // LatticeModel.hpp
3 | // CppOptions
4 | //
5 | // (c) 2020 Carlos Oliveira
6 | // This code is part of the book
7 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
8 | // by Carlos Oliveira, Apress, 2020.
9 | // For more information, visit http://coliveira.net
10 |
11 | #ifndef LatticeModel_hpp
12 | #define LatticeModel_hpp
13 |
14 | #include
15 |
16 | #endif /* LatticeModel_hpp */
17 |
--------------------------------------------------------------------------------
/CppOptions/BlackScholesPricer.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // BlackScholesPricer.hpp
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #ifndef BlackScholesPricer_hpp
12 | #define BlackScholesPricer_hpp
13 |
14 |
15 |
16 |
17 |
18 | #endif /* BlackScholesPricer_hpp */
19 |
--------------------------------------------------------------------------------
/CppOptions/GericDerivative.h:
--------------------------------------------------------------------------------
1 | //
2 | // GericDerivative.h
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #ifndef __CppOptions__GericDerivative__
12 | #define __CppOptions__GericDerivative__
13 |
14 | #include
15 |
16 | #endif /* defined(__CppOptions__GericDerivative__) */
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Apress Source Code
2 |
3 | This repository accompanies [*Options and Derivatives Programming in C++20*](https://www.apress.com/9781484263143) by Carlos Oliveira (Apress, 2020).
4 |
5 | [comment]: #cover
6 | 
7 |
8 | Download the files as a zip using the green button, or clone the repository to your machine using Git.
9 |
10 | ## Releases
11 |
12 | Release v1.0 corresponds to the code in the published book, without corrections or updates.
13 |
14 | ## Contributions
15 |
16 | See the file Contributing.md for more information on how you can contribute to this repository.
--------------------------------------------------------------------------------
/CppOptions/qlibsample.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // qlibsample.hpp
3 | //
4 | // (c) 2020 Carlos Oliveira
5 | // This code is part of the book
6 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
7 | // by Carlos Oliveira, Apress, 2020.
8 | // For more information, visit http://coliveira.net
9 |
10 |
11 | #ifndef qlibsample_hpp
12 | #define qlibsample_hpp
13 |
14 | #include
15 |
16 |
17 | #include
18 |
19 |
20 | #include
21 |
22 |
23 |
24 |
25 |
26 | #endif /* qlibsample_hpp */
27 |
--------------------------------------------------------------------------------
/CppOptions.xcodeproj/xcuserdata/carlosoliveira.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CppOptions.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 739F95401B50183A00966A6F
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing to Apress Source Code
2 |
3 | Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers.
4 |
5 | ## How to Contribute
6 |
7 | 1. Make sure you have a GitHub account.
8 | 2. Fork the repository for the relevant book.
9 | 3. Create a new branch on which to make your change, e.g.
10 | `git checkout -b my_code_contribution`
11 | 4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted.
12 | 5. Submit a pull request.
13 |
14 | Thank you for your contribution!
--------------------------------------------------------------------------------
/CppOptions/hist.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // hist.cpp
3 | // CppOptions
4 | //
5 | // Created by Carlos Oliveira on 8/8/20.
6 | // Copyright © 2020 Carlos Oliveira. All rights reserved.
7 | //
8 |
9 | #include "hist.hpp"
10 |
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | int main() {
20 | using namespace boost::histogram;
21 |
22 | std::ostringstream os;
23 |
24 | auto h1 = make_histogram(axis::regular<>(5, -1.0, 1.0, "axis 1"));
25 | h1.at(0) = 2;
26 | h1.at(1) = 4;
27 | h1.at(2) = 3;
28 | h1.at(4) = 1;
29 |
30 | // 1D histograms are rendered as an ASCII drawing
31 | os << h1;
32 | std::cout << h1;
33 | return 0;
34 | }
35 |
--------------------------------------------------------------------------------
/CppOptions/c20test.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // c20test.cpp
3 | // CppOptions
4 | //
5 | // (c) 2020 Carlos Oliveira
6 | // This code is part of the book
7 | // "Options and Derivatives Programming in C++20: Algorithms and Programming Techniques for the Financial Industry 2nd Edition"
8 | // by Carlos Oliveira, Apress, 2020.
9 | // For more information, visit http://coliveira.net
10 |
11 | #include "c20test.hpp"
12 |
13 | #include
14 | #include
15 | #include