Skip to content

tesseradecade/dynamic-domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamic domain

Dynamic domain implementation for linear algebra purposes

WIP

creating domain

use dynamic_domain::{Domain, Value};

fn main() {
    // [5;10)
    let domain = Domain::Domain(
        Value::Included(5),
        Value::Secluded(10)
    );
    println("{}", domain.repr());
}

border optimization

use dynamic_domain::{Domain, Value};

fn main() {
    // (3;5]
    let mut domain = Domain::new()
        .lt(Value::Included(5))
        .gt(Value::Secluded(3))
        .gt(Value::Secluded(1));
    println!("{}", domain.repr());
}

representative notation

union

use dynamic_domain::{Domain, Value};

fn main() {
    // domain1 = (-∞;5)
    // domain2 = [8;100]
    let domain = Domain::Union(vec![domain1, domain2]);
    println!("{}", domain.repr()); // (-∞;5)⋃[8;100]
}

empty set

use dynamic_domain::{Domain, Value};

fn main() {
    let domain = Domain::None;
    println!("{}", domain.repr()); // ∅
}

generate

use dynamic_domain::{Domain, Value};

fn receiver(i: i32, context: &()) {
    println!("{}", i);
}

fn main() {
    let domain = Domain::Domain(
        Value::Included(5),
        Value::Secluded(10)
    );
    domain.generate(receiver, &());
}

todo

  • constraint

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Languages