Trait flussab_cnf::Dimacs

source ·
pub trait Dimacs: Copy + Eq {
    const MAX_DIMACS: isize;

    // Required methods
    fn from_dimacs(value: isize) -> Self;
    fn dimacs(self) -> isize;
}
Expand description

Type that can be used to represent literals and variables in DIMACS CNF and related file formats.

Required Associated Constants§

source

const MAX_DIMACS: isize

Largest literal / variable supported.

Required Methods§

source

fn from_dimacs(value: isize) -> Self

Returns a literal / variable that is encoded as the passed integer in the DIMACS CNF format.

If the value is out of range, e.g. negative for a variable, this may panic or return an arbitrary value.

source

fn dimacs(self) -> isize

Returns the integer that is used to encode this literal / variable in the DIMACS CNF format.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Dimacs for i8

source§

const MAX_DIMACS: isize = 127isize

source§

fn from_dimacs(value: isize) -> Self

source§

fn dimacs(self) -> isize

source§

impl Dimacs for i16

source§

const MAX_DIMACS: isize = 32_767isize

source§

fn from_dimacs(value: isize) -> Self

source§

fn dimacs(self) -> isize

source§

impl Dimacs for i32

source§

const MAX_DIMACS: isize = 2_147_483_647isize

source§

fn from_dimacs(value: isize) -> Self

source§

fn dimacs(self) -> isize

source§

impl Dimacs for i64

source§

const MAX_DIMACS: isize = 9_223_372_036_854_775_807isize

source§

fn from_dimacs(value: isize) -> Self

source§

fn dimacs(self) -> isize

source§

impl Dimacs for isize

source§

const MAX_DIMACS: isize = 9_223_372_036_854_775_807isize

source§

fn from_dimacs(value: isize) -> Self

source§

fn dimacs(self) -> isize

Implementors§