SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
What’s next in Jul_
Jiahao Chen
MIT Computer Science and Artificial Intelligence Laboratory
julialang.org
Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah
What’s the big deal about Julia ?
julialang.org/benchmarks
It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
data abstraction
performance
It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
data abstraction
performance
What if you didn’t have to choose between
data abstraction and performance?
It’s a programming language designed for technical computing
What’s the big deal about Julia ?
It’s a programming language designed for technical computing
What’s the big deal about Julia ?
The key ingredients
Multi-methods (multiple dispatch)
Dataflow type inference
together allow for cost-efficient data abstraction
Object-oriented programming with classes
What can I do with/to a thing?
Object-oriented programming with classes
What can I do with/to a thing?
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
pay fare
lose
buy
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
pay fare
lose
buy
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
pay fare
lose
buy
class-based OO
!
classes are more
fundamental
than methods
Object-oriented programming with multi-methods
What can I do with/to a thing?
top up
pay fare
lose
buy
generic
function
objectsmethods
Object-oriented programming with multi-methods
What can I do with/to a thing?
top up
pay fare
lose
buy
generic
function
objectsmethods
multimethods
!
relationships between
objects and functions
Multi-methods with type hierarchy
top up
pay fare
lose
buy
generic
function
objectsmethods
rechargeable
subway
pass
single-use
subway
ticket
is a subtype of
subway
ticket
abstract object
generic
function
objectsmethods
rechargeable
subway
pass
single-use
subway
ticket
is a subtype of
subway
ticket
top up
pay fare
lose
buy
abstract object
Multi-methods with type hierarchy
generic
function
objectsmethods
rechargeable
subway
pass
single-use
subway
ticket
is a subtype of
subway
ticket
top up
pay fare
lose
buy
abstract object
Multi-methods with type hierarchy
The Julia codebase is compact
5,774 lines of Scheme
32,707 lines of C
59727 lines of Julia
!
+LLVM, BLAS, LAPACK, SuiteSparse, ARPACK,
Rmath, GMP, MPFR, FFTW,…
Data types as a lattice
Dana Scott, Data types as lattices, SIAM J. Comput. 5: 522-87. 1976
Real
Number
FloatingPoint Rational
Complex
Float64 BigFloat…
…
Integer
is a parameter of
is a subtype of
Signed BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
no method here either
super(Signed) = Integer
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
no method here either
super(Signed) = Integer
found a method
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Julia
LLVM IR
Machine assembly
aggressive type specialization
!
compiler generates specialized
methods for different input types
to the same generic function
unitful computations with
essentially no runtime
overhead
Keno Fischer
Harvard
Physics and Mathematics
Type lattice of arrays
DenseArray{T, N}
AbstractArray{T, N}
Array{T, N}
…
is a subtype of
Any
Array{T,1}===Vector{T}	
Array{T,2}===Matrix{T}
A single parametric type defines many types
of matrices
Matrix{Float64}, Matrix{Int64},	
Matrix{BigFloat}, Matrix{Complex128},	
Matrix{Rational}, Matrix{Quaternion{Float64}},…
Type lattice of arrays
DenseArray{T, N}
AbstractArray{T, N}
Array{T, N}
…
is a subtype of
Any
Array{T,1}===Vector{T}	
Array{T,2}===Matrix{T}
A single parametric type defines many types
of matrices
Matrix{Float64}, Matrix{Int64},	
Matrix{BigFloat}, Matrix{Complex128},	
Matrix{Rational}, Matrix{Quaternion{Float64}},…
Type lattice of arrays
DenseArray{T, N}
AbstractArray{T, N}
Array{T, N}
…
is a subtype of
Any
Array{T,1}===Vector{T}	
Array{T,2}===Matrix{T}
rotation matrices
structured matrices
distributed arrays
A single parametric type defines many types
of matrices
Matrix{Float64}, Matrix{Int64},	
Matrix{BigFloat}, Matrix{Complex128},	
Matrix{Rational}, Matrix{Quaternion{Float64}},…
Multi-methods for linear algebra
What can I do with/to a thing?
find eigenvalues and eigenvectors
find singular values
find singular values and vectors
find eigenvalues
generic
function
objectsmethods
general matrix
symmetric tridiagonal matrix
bidiagonal matrix
Methods can take advantage of special matrix structures
eigvals
eigfact
svdvals
svdfact
Matrix
SymTridiagonal
Bidiagonal
So how does this help us with linear algebra?
So how does this help us with linear algebra?
Multi-method dispatch on special matrix types
So how does this help us with linear algebra?
Multi-method dispatch on special matrix types
So how does this help us with linear algebra?
Multi-method dispatch on special matrix types
stev!{T<:BlasFloat} calls sgestv	
dgestv	
cgestv	
zgestv	
and handles workspace
memory allocation
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings textbook algorithm
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
Matrix factorization types
Iterative algorithms as iterators
for item in iterable	
#body	
end	
!
#is equivalent to	
!
state = start(iterable) 	
while !done(iterable, state) 	
item, state = next(iterable, state) 	
# body	
end
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
Can we write this as an iterator?
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
Can we write this as an iterator?
state = start(iterable)
done(iterable, state)
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
state = start(iterable)
done(iterable, state)
state, dx = next(iterable, state)
immutable cg_hs #iterative solver	
K :: KrylovSpace #wraps A, v0, k	
t :: Terminator #termination criteria	
end	
	
immutable cg_hs_state	
r :: Vector #residual	
p :: Vector #search direction	
rnormsq :: Float64 #Squared norm of previous residual	
iter :: Int #iteration count	
end	
	
start(a::cg_hs) = cg_hs_state(a.K.v0,	
zeros(size(a.K.v0,1)), Inf, 0)	
	
function next(a::cg_hs, s::cg_hs_state)	
rnormsq = dot(s.r, s.r)	
p = s.r + (rnormsq/s.rnormsq)*s.p	
Ap = a.K.A*p	
α = rnormsq / dot(p, Ap)	
α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1)	
end	
	
done(a::cg_hs, s::cg_hs_state) = done(a.t, s)	
!
K = method(KrylovSpace(A, b, k), Terminator())	
x += reduce(+, K) # for dx in K; x += dx; end
Hestenes-Stiefel CG
immutable cg_hs #iterative solver	
K :: KrylovSpace #wraps A, v0, k	
t :: Terminator #termination criteria	
end	
	
immutable cg_hs_state	
r :: Vector #residual	
p :: Vector #search direction	
rnormsq :: Float64 #Squared norm of previous residual	
iter :: Int #iteration count	
end	
	
start(a::cg_hs) = cg_hs_state(a.K.v0,	
zeros(size(a.K.v0,1)), Inf, 0)	
	
function next(a::cg_hs, s::cg_hs_state)	
rnormsq = dot(s.r, s.r)	
p = s.r + (rnormsq/s.rnormsq)*s.p	
Ap = a.K.A*p	
α = rnormsq / dot(p, Ap)	
α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1)	
end	
	
done(a::cg_hs, s::cg_hs_state) = done(a.t, s)	
!
K = method(KrylovSpace(A, b, k), Terminator())	
x += reduce(+, K) # for dx in K; x += dx; end
Hestenes-Stiefel CG
Abstracts out termination check and solution update steps
Native parallelism constructs
Native parallelism constructs
Native parallelism constructs
Distributed arrays
IJulia: Julia in IPython Notebook
IJulia: Julia in IPython Notebook
JuMP: writing simple DSLs in Julia
Iain Dunning Miles Lubin
MIT
Operations Research
Andreas N. Jensen
U. Copenhagen
Economics
Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah
Carlo Baldassi
Poly. Torino
Neuroscience
Tim E. Holy
WUSTL
Anatomy
Douglas M. Bates
Wisconsin-Madison
Statistics
Steven G. Johnson
MIT
Mathematics

Weitere ähnliche Inhalte

Was ist angesagt?

An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryJoyjit Choudhury
 
Stl Containers
Stl ContainersStl Containers
Stl Containersppd1961
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)Ali ٍSattar
 
Gleaning Types for Literals in RDF with Application to Entity Summarization
Gleaning Types for Literals in RDF with Application to Entity SummarizationGleaning Types for Literals in RDF with Application to Entity Summarization
Gleaning Types for Literals in RDF with Application to Entity SummarizationKalpa Gunaratna
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II NotesAndrew Raj
 
Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingHaitham El-Ghareeb
 
Latent Semanctic Analysis Auro Tripathy
Latent Semanctic Analysis Auro TripathyLatent Semanctic Analysis Auro Tripathy
Latent Semanctic Analysis Auro TripathyAuro Tripathy
 
Standard template library
Standard template libraryStandard template library
Standard template librarySukriti Singh
 
Data Science as a Career and Intro to R
Data Science as a Career and Intro to RData Science as a Career and Intro to R
Data Science as a Career and Intro to RAnshik Bansal
 
Standard template library
Standard template libraryStandard template library
Standard template libraryJancypriya M
 

Was ist angesagt? (20)

Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11
 
Smali语法
Smali语法Smali语法
Smali语法
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Gleaning Types for Literals in RDF with Application to Entity Summarization
Gleaning Types for Literals in RDF with Application to Entity SummarizationGleaning Types for Literals in RDF with Application to Entity Summarization
Gleaning Types for Literals in RDF with Application to Entity Summarization
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes
 
Lect07
Lect07Lect07
Lect07
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic Sorting
 
DSA - Lecture 04
DSA - Lecture 04DSA - Lecture 04
DSA - Lecture 04
 
Sharbani bhattacharya VB Structures
Sharbani bhattacharya VB StructuresSharbani bhattacharya VB Structures
Sharbani bhattacharya VB Structures
 
Oo ps exam answer2
Oo ps exam answer2Oo ps exam answer2
Oo ps exam answer2
 
Latent Semanctic Analysis Auro Tripathy
Latent Semanctic Analysis Auro TripathyLatent Semanctic Analysis Auro Tripathy
Latent Semanctic Analysis Auro Tripathy
 
DSA-Lecture-05
DSA-Lecture-05DSA-Lecture-05
DSA-Lecture-05
 
Standard template library
Standard template libraryStandard template library
Standard template library
 
Data Science as a Career and Intro to R
Data Science as a Career and Intro to RData Science as a Career and Intro to R
Data Science as a Career and Intro to R
 
Standard template library
Standard template libraryStandard template library
Standard template library
 

Andere mochten auch

Julia: compiler and community
Julia: compiler and communityJulia: compiler and community
Julia: compiler and communityJiahao Chen
 
Programming languages: history, relativity and design
Programming languages: history, relativity and designProgramming languages: history, relativity and design
Programming languages: history, relativity and designJiahao Chen
 
An introduction to Julia
An introduction to JuliaAn introduction to Julia
An introduction to JuliaJiahao Chen
 
Julia? why a new language, an an application to genomics data analysis
Julia? why a new language, an an application to genomics data analysisJulia? why a new language, an an application to genomics data analysis
Julia? why a new language, an an application to genomics data analysisJiahao Chen
 
Genomics data analysis in Julia
Genomics data analysis in JuliaGenomics data analysis in Julia
Genomics data analysis in JuliaJiahao Chen
 
Understanding ECG signals in the MIMIC II database
Understanding ECG signals in the MIMIC II databaseUnderstanding ECG signals in the MIMIC II database
Understanding ECG signals in the MIMIC II databaseJiahao Chen
 
A brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTA brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTJiahao Chen
 
Technical computing in Julia
Technical computing in JuliaTechnical computing in Julia
Technical computing in JuliaJiahao Chen
 
Julia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJulia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJiahao Chen
 
Resolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge modelsResolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge modelsJiahao Chen
 
Julia, genomics data and their principal components
Julia, genomics data and their principal componentsJulia, genomics data and their principal components
Julia, genomics data and their principal componentsJiahao Chen
 
Excitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic MembranesExcitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic MembranesJiahao Chen
 
A Julia package for iterative SVDs with applications to genomics data analysis
A Julia package for iterative SVDs with applications to genomics data analysisA Julia package for iterative SVDs with applications to genomics data analysis
A Julia package for iterative SVDs with applications to genomics data analysisJiahao Chen
 
Group meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electronsGroup meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electronsJiahao Chen
 
Theory and application of fluctuating-charge models
Theory and application of fluctuating-charge modelsTheory and application of fluctuating-charge models
Theory and application of fluctuating-charge modelsJiahao Chen
 
Python as number crunching code glue
Python as number crunching code gluePython as number crunching code glue
Python as number crunching code glueJiahao Chen
 
High performance computing language,julia
High performance computing language,juliaHigh performance computing language,julia
High performance computing language,juliaAnusha sweety
 

Andere mochten auch (17)

Julia: compiler and community
Julia: compiler and communityJulia: compiler and community
Julia: compiler and community
 
Programming languages: history, relativity and design
Programming languages: history, relativity and designProgramming languages: history, relativity and design
Programming languages: history, relativity and design
 
An introduction to Julia
An introduction to JuliaAn introduction to Julia
An introduction to Julia
 
Julia? why a new language, an an application to genomics data analysis
Julia? why a new language, an an application to genomics data analysisJulia? why a new language, an an application to genomics data analysis
Julia? why a new language, an an application to genomics data analysis
 
Genomics data analysis in Julia
Genomics data analysis in JuliaGenomics data analysis in Julia
Genomics data analysis in Julia
 
Understanding ECG signals in the MIMIC II database
Understanding ECG signals in the MIMIC II databaseUnderstanding ECG signals in the MIMIC II database
Understanding ECG signals in the MIMIC II database
 
A brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTA brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFT
 
Technical computing in Julia
Technical computing in JuliaTechnical computing in Julia
Technical computing in Julia
 
Julia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJulia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performance
 
Resolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge modelsResolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge models
 
Julia, genomics data and their principal components
Julia, genomics data and their principal componentsJulia, genomics data and their principal components
Julia, genomics data and their principal components
 
Excitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic MembranesExcitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic Membranes
 
A Julia package for iterative SVDs with applications to genomics data analysis
A Julia package for iterative SVDs with applications to genomics data analysisA Julia package for iterative SVDs with applications to genomics data analysis
A Julia package for iterative SVDs with applications to genomics data analysis
 
Group meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electronsGroup meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electrons
 
Theory and application of fluctuating-charge models
Theory and application of fluctuating-charge modelsTheory and application of fluctuating-charge models
Theory and application of fluctuating-charge models
 
Python as number crunching code glue
Python as number crunching code gluePython as number crunching code glue
Python as number crunching code glue
 
High performance computing language,julia
High performance computing language,juliaHigh performance computing language,julia
High performance computing language,julia
 

Ähnlich wie What's next in Julia

Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against YouC4Media
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoPaulo Morgado
 
Lambdas: Myths and Mistakes
Lambdas: Myths and MistakesLambdas: Myths and Mistakes
Lambdas: Myths and MistakesRichardWarburton
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
An Answer Set Programming based framework for High-Utility Pattern Mining ext...
An Answer Set Programming based framework for High-Utility Pattern Mining ext...An Answer Set Programming based framework for High-Utility Pattern Mining ext...
An Answer Set Programming based framework for High-Utility Pattern Mining ext...Francesco Cauteruccio
 
Monads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevMonads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevJavaDayUA
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1ecomputernotes
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?Kevin Pilch
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
Nimrita koul Machine Learning
Nimrita koul  Machine LearningNimrita koul  Machine Learning
Nimrita koul Machine LearningNimrita Koul
 
Roberto Trasarti PhD Thesis
Roberto Trasarti PhD ThesisRoberto Trasarti PhD Thesis
Roberto Trasarti PhD ThesisRoberto Trasarti
 
Computer notes - data structures
Computer notes - data structuresComputer notes - data structures
Computer notes - data structuresecomputernotes
 
C Interview Questions for Fresher
C Interview Questions for FresherC Interview Questions for Fresher
C Interview Questions for FresherJaved Ahmad
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparationsonu sharma
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparationKgr Sushmitha
 

Ähnlich wie What's next in Julia (20)

Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
 
Lambdas: Myths and Mistakes
Lambdas: Myths and MistakesLambdas: Myths and Mistakes
Lambdas: Myths and Mistakes
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
An Answer Set Programming based framework for High-Utility Pattern Mining ext...
An Answer Set Programming based framework for High-Utility Pattern Mining ext...An Answer Set Programming based framework for High-Utility Pattern Mining ext...
An Answer Set Programming based framework for High-Utility Pattern Mining ext...
 
fds u1.docx
fds u1.docxfds u1.docx
fds u1.docx
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Monads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevMonads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy Dyagilev
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?
 
Bt0065
Bt0065Bt0065
Bt0065
 
B T0065
B T0065B T0065
B T0065
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Nimrita koul Machine Learning
Nimrita koul  Machine LearningNimrita koul  Machine Learning
Nimrita koul Machine Learning
 
Data types
Data typesData types
Data types
 
Roberto Trasarti PhD Thesis
Roberto Trasarti PhD ThesisRoberto Trasarti PhD Thesis
Roberto Trasarti PhD Thesis
 
Computer notes - data structures
Computer notes - data structuresComputer notes - data structures
Computer notes - data structures
 
C Interview Questions for Fresher
C Interview Questions for FresherC Interview Questions for Fresher
C Interview Questions for Fresher
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 

Kürzlich hochgeladen

Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...amitlee9823
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...gajnagarg
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Pooja Nehwal
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...gajnagarg
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...gajnagarg
 

Kürzlich hochgeladen (20)

Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
 

What's next in Julia

  • 1. What’s next in Jul_ Jiahao Chen MIT Computer Science and Artificial Intelligence Laboratory julialang.org Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah
  • 2. What’s the big deal about Julia ? julialang.org/benchmarks
  • 3. It bridges the divide between computer science and computational science What’s the big deal about Julia ?
  • 4. It bridges the divide between computer science and computational science What’s the big deal about Julia ? data abstraction performance
  • 5. It bridges the divide between computer science and computational science What’s the big deal about Julia ? data abstraction performance What if you didn’t have to choose between data abstraction and performance?
  • 6. It’s a programming language designed for technical computing What’s the big deal about Julia ?
  • 7. It’s a programming language designed for technical computing What’s the big deal about Julia ? The key ingredients Multi-methods (multiple dispatch) Dataflow type inference together allow for cost-efficient data abstraction
  • 8. Object-oriented programming with classes What can I do with/to a thing?
  • 9. Object-oriented programming with classes What can I do with/to a thing?
  • 10. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy
  • 11. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy
  • 12. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy
  • 13. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy pay fare lose buy
  • 14. methods objects Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy pay fare lose buy
  • 15. methods objects Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy pay fare lose buy class-based OO ! classes are more fundamental than methods
  • 16. Object-oriented programming with multi-methods What can I do with/to a thing? top up pay fare lose buy generic function objectsmethods
  • 17. Object-oriented programming with multi-methods What can I do with/to a thing? top up pay fare lose buy generic function objectsmethods multimethods ! relationships between objects and functions
  • 18. Multi-methods with type hierarchy top up pay fare lose buy generic function objectsmethods rechargeable subway pass single-use subway ticket is a subtype of subway ticket abstract object
  • 19. generic function objectsmethods rechargeable subway pass single-use subway ticket is a subtype of subway ticket top up pay fare lose buy abstract object Multi-methods with type hierarchy
  • 20. generic function objectsmethods rechargeable subway pass single-use subway ticket is a subtype of subway ticket top up pay fare lose buy abstract object Multi-methods with type hierarchy
  • 21. The Julia codebase is compact 5,774 lines of Scheme 32,707 lines of C 59727 lines of Julia ! +LLVM, BLAS, LAPACK, SuiteSparse, ARPACK, Rmath, GMP, MPFR, FFTW,…
  • 22. Data types as a lattice Dana Scott, Data types as lattices, SIAM J. Comput. 5: 522-87. 1976 Real Number FloatingPoint Rational Complex Float64 BigFloat… … Integer is a parameter of is a subtype of Signed BigInt Any Int64… …
  • 23. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 24. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 25. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 26. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… … no method here try supertype super(Int64) = Signed
  • 27. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… … no method here try supertype super(Int64) = Signed no method here either super(Signed) = Integer
  • 28. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… … no method here try supertype super(Int64) = Signed no method here either super(Signed) = Integer found a method
  • 29. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 30. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 31.
  • 33.
  • 34. aggressive type specialization ! compiler generates specialized methods for different input types to the same generic function
  • 35. unitful computations with essentially no runtime overhead Keno Fischer Harvard Physics and Mathematics
  • 36. Type lattice of arrays DenseArray{T, N} AbstractArray{T, N} Array{T, N} … is a subtype of Any Array{T,1}===Vector{T} Array{T,2}===Matrix{T} A single parametric type defines many types of matrices Matrix{Float64}, Matrix{Int64}, Matrix{BigFloat}, Matrix{Complex128}, Matrix{Rational}, Matrix{Quaternion{Float64}},…
  • 37. Type lattice of arrays DenseArray{T, N} AbstractArray{T, N} Array{T, N} … is a subtype of Any Array{T,1}===Vector{T} Array{T,2}===Matrix{T} A single parametric type defines many types of matrices Matrix{Float64}, Matrix{Int64}, Matrix{BigFloat}, Matrix{Complex128}, Matrix{Rational}, Matrix{Quaternion{Float64}},…
  • 38. Type lattice of arrays DenseArray{T, N} AbstractArray{T, N} Array{T, N} … is a subtype of Any Array{T,1}===Vector{T} Array{T,2}===Matrix{T} rotation matrices structured matrices distributed arrays A single parametric type defines many types of matrices Matrix{Float64}, Matrix{Int64}, Matrix{BigFloat}, Matrix{Complex128}, Matrix{Rational}, Matrix{Quaternion{Float64}},…
  • 39. Multi-methods for linear algebra What can I do with/to a thing? find eigenvalues and eigenvectors find singular values find singular values and vectors find eigenvalues generic function objectsmethods general matrix symmetric tridiagonal matrix bidiagonal matrix Methods can take advantage of special matrix structures eigvals eigfact svdvals svdfact Matrix SymTridiagonal Bidiagonal
  • 40. So how does this help us with linear algebra?
  • 41. So how does this help us with linear algebra? Multi-method dispatch on special matrix types
  • 42. So how does this help us with linear algebra? Multi-method dispatch on special matrix types
  • 43. So how does this help us with linear algebra? Multi-method dispatch on special matrix types stev!{T<:BlasFloat} calls sgestv dgestv cgestv zgestv and handles workspace memory allocation
  • 44. So how does this help us with linear algebra? Multi-method dispatch with generic fallbacks Matrix operations on general rings
  • 45. So how does this help us with linear algebra? Multi-method dispatch with generic fallbacks Matrix operations on general rings textbook algorithm
  • 46. So how does this help us with linear algebra? Multi-method dispatch with generic fallbacks Matrix operations on general rings
  • 48. Iterative algorithms as iterators for item in iterable #body end ! #is equivalent to ! state = start(iterable) while !done(iterable, state) item, state = next(iterable, state) # body end
  • 51. Conjugate gradients (Hestenes-Stiefel) http://en.wikipedia.org/wiki/Conjugate_gradient_method Can we write this as an iterator? state = start(iterable) done(iterable, state)
  • 52. Conjugate gradients (Hestenes-Stiefel) http://en.wikipedia.org/wiki/Conjugate_gradient_method state = start(iterable) done(iterable, state) state, dx = next(iterable, state)
  • 53. immutable cg_hs #iterative solver K :: KrylovSpace #wraps A, v0, k t :: Terminator #termination criteria end immutable cg_hs_state r :: Vector #residual p :: Vector #search direction rnormsq :: Float64 #Squared norm of previous residual iter :: Int #iteration count end start(a::cg_hs) = cg_hs_state(a.K.v0, zeros(size(a.K.v0,1)), Inf, 0) function next(a::cg_hs, s::cg_hs_state) rnormsq = dot(s.r, s.r) p = s.r + (rnormsq/s.rnormsq)*s.p Ap = a.K.A*p α = rnormsq / dot(p, Ap) α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1) end done(a::cg_hs, s::cg_hs_state) = done(a.t, s) ! K = method(KrylovSpace(A, b, k), Terminator()) x += reduce(+, K) # for dx in K; x += dx; end Hestenes-Stiefel CG
  • 54. immutable cg_hs #iterative solver K :: KrylovSpace #wraps A, v0, k t :: Terminator #termination criteria end immutable cg_hs_state r :: Vector #residual p :: Vector #search direction rnormsq :: Float64 #Squared norm of previous residual iter :: Int #iteration count end start(a::cg_hs) = cg_hs_state(a.K.v0, zeros(size(a.K.v0,1)), Inf, 0) function next(a::cg_hs, s::cg_hs_state) rnormsq = dot(s.r, s.r) p = s.r + (rnormsq/s.rnormsq)*s.p Ap = a.K.A*p α = rnormsq / dot(p, Ap) α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1) end done(a::cg_hs, s::cg_hs_state) = done(a.t, s) ! K = method(KrylovSpace(A, b, k), Terminator()) x += reduce(+, K) # for dx in K; x += dx; end Hestenes-Stiefel CG Abstracts out termination check and solution update steps
  • 59. IJulia: Julia in IPython Notebook
  • 60. IJulia: Julia in IPython Notebook
  • 61. JuMP: writing simple DSLs in Julia Iain Dunning Miles Lubin MIT Operations Research
  • 62. Andreas N. Jensen U. Copenhagen Economics Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah Carlo Baldassi Poly. Torino Neuroscience Tim E. Holy WUSTL Anatomy Douglas M. Bates Wisconsin-Madison Statistics Steven G. Johnson MIT Mathematics