Some facts about me:
- Studying at Technical University Munich (Informatics M.Sc.) ๐
- Working at QuickBird as Software Engineer ๐จ๐ผโ๐ป
- Constantly learning, developing, trying out new things and finding better ways to solve problems ๐ฑ
Math operations and their realizations in code
Home Page: http://pauljohanneskraft.github.io/CoreMath/
License: MIT License
Some facts about me:
a mathematical equivalent to equations
--> because Polynomial doesn't allow to model log(x), sin(x), etc
struct Equation having an array of Terms
Term is a struct containing a description and a function calculating the result
split up reduced into:
--> factorized
--> expand
Currently Travis-CI only builds Math on Linux without running the test suite.
As no code is run in the current scenario, it cannot be assured, that the code really runs correctly on Linux.
As the source code is the same and it should run the same way on Linux as on OS X, this has low/zero priority.
This may be a Swift error due to its "beta" status.
Operators declared in the project can't be used in test functions due to "ambigous operator"-errors.
Some operators work, some don't.
Already importing project using "@testable import Math".
Error shows definition in the project, as well as where it is used...
_Polynomial and Polynomial somehow need to be combined in the function system
--> adding polynomial division in Fraction.reduced
--> maybe some function to test if equation is "pure" polynomial?
After changing from a folder structure where all files were located in Sources/ directly and not in any subfolders, Linux builds always failed.
At this point there are only a few improvements of functions in the reduce()-method
--> can still be improved
Travis builds on Linux throw this mysterious error, somehow connected to type checking
(surprisingly only one test method fails (addition, subtraction, division seem to be fine...))
#0 0x000000000334a5b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x334a5b8)
#1 0x0000000003348d86 llvm::sys::RunSignalHandlers() (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x3348d86)
#2 0x000000000334b0ea SignalHandler(int) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x334b0ea)
#3 0x00007ffb823fc330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x0000000000fe443b swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe443b)
#5 0x0000000000fe255f swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe255f)
#6 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#7 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#8 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#9 0x0000000000fe255f swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe255f)
#10 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#11 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#12 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#13 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#14 0x0000000000fe81ef swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe81ef)
#15 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#16 0x0000000000fe81ef swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe81ef)
#17 0x0000000000fe255f swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe255f)
#18 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#19 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#20 0x0000000000fe1609 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1609)
#21 0x0000000000fe425a swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe425a)
#22 0x0000000000ec1843 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImplswift::constraints::Solution&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xec1843)
#23 0x0000000000ec4e3d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xec4e3d)
#24 0x0000000000f47b50 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf47b50)
#25 0x0000000000f466c5 (anonymous namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf466c5)
#26 0x0000000000f4591a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf4591a)
#27 0x0000000000f4577e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf4577e)
#28 0x0000000000f46343 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf46343)
#29 0x0000000000eff276 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xeff276)
#30 0x0000000000effda1 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xeffda1)
#31 0x0000000000c8065b swift::CompilerInstance::performSema() (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xc8065b)
#32 0x00000000007ddce0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7ddce0)
#33 0x00000000007dcc57 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7dcc57)
#34 0x00000000007a8718 main (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7a8718)
#35 0x00007ffb80ba5f45 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f45)
#36 0x00000000007a6116 _start (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7a6116)
Stack dump:
0. Program arguments: /home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift -frontend -c /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/_PolynomialTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/TrigonometricFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ConstantsTest.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/GrowthTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/RingTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/CustomFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/BasicArithmeticTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ComplexTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/TeXTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/GroupTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/AdvancedNumericTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/MatrixTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/PolynomialFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/EquationTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ConstantFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/EnhancedNumberTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/TermTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/DataTypeTest.swift -primary-file /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/RationalNumberTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ModuleTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/NumericTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/FractionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/PolynomialTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/LinuxCompatibilityTests.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/travis/build/pauljohanneskraft/Math/.build/debug -enable-testing -g -module-cache-path /home/travis/build/pauljohanneskraft/Math/.build/debug/ModuleCache -D SWIFT_PACKAGE -emit-module-doc-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTestspartial.swiftdoc -Onone -parse-as-library -module-name MathTests -emit-module-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTestspartial.swiftmodule -emit-dependencies-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTests.d -emit-reference-dependencies-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTests.swiftdeps -num-threads 8 -o /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTests.swift.o
As Exponential is a more general way to think about a Polynomial, this could actually be merged into one type...
A more in-depth look at calculus of a^b is needed.
Maybe having protocols for like every operator on it's own would be better?...
maybe through some property like:
protocol Function {
// ...
var growthClass : GrowthClass { get }
}
// not static, because e.g. Polynomial has a variable exponent
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.