Changeset 8555
 Timestamp:
 02/13/05 04:02:22 (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/j/src/org/armedbear/lisp/SimpleBitVector.java
r8550 r8555 3 3 * 4 4 * Copyright (C) 20042005 Peter Graves 5 * $Id: SimpleBitVector.java,v 1.1 1 20050212 20:56:44piso Exp $5 * $Id: SimpleBitVector.java,v 1.12 20050213 04:02:22 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 221 221 } 222 222 223 p ublicSimpleBitVector and(SimpleBitVector v, SimpleBitVector result)223 private SimpleBitVector and(SimpleBitVector v, SimpleBitVector result) 224 224 { 225 225 if (result == null) … … 230 230 } 231 231 232 p ublicSimpleBitVector ior(SimpleBitVector v, SimpleBitVector result)232 private SimpleBitVector ior(SimpleBitVector v, SimpleBitVector result) 233 233 { 234 234 if (result == null) … … 239 239 } 240 240 241 p ublicSimpleBitVector xor(SimpleBitVector v, SimpleBitVector result)241 private SimpleBitVector xor(SimpleBitVector v, SimpleBitVector result) 242 242 { 243 243 if (result == null) … … 248 248 } 249 249 250 public SimpleBitVector nand(SimpleBitVector v, SimpleBitVector result) 250 private SimpleBitVector eqv(SimpleBitVector v, SimpleBitVector result) 251 { 252 if (result == null) 253 result = new SimpleBitVector(capacity); 254 for (int i = bits.length; i > 0;) 255 result.bits[i] = ~(bits[i] ^ v.bits[i]); 256 return result; 257 } 258 259 private SimpleBitVector nand(SimpleBitVector v, SimpleBitVector result) 251 260 { 252 261 if (result == null) … … 254 263 for (int i = bits.length; i > 0;) 255 264 result.bits[i] = ~(bits[i] & v.bits[i]); 265 return result; 266 } 267 268 private SimpleBitVector nor(SimpleBitVector v, SimpleBitVector result) 269 { 270 if (result == null) 271 result = new SimpleBitVector(capacity); 272 for (int i = bits.length; i > 0;) 273 result.bits[i] = ~(bits[i]  v.bits[i]); 274 return result; 275 } 276 277 private SimpleBitVector andc1(SimpleBitVector v, SimpleBitVector result) 278 { 279 if (result == null) 280 result = new SimpleBitVector(capacity); 281 for (int i = bits.length; i > 0;) 282 result.bits[i] = ~bits[i] & v.bits[i]; 283 return result; 284 } 285 286 private SimpleBitVector andc2(SimpleBitVector v, SimpleBitVector result) 287 { 288 if (result == null) 289 result = new SimpleBitVector(capacity); 290 for (int i = bits.length; i > 0;) 291 result.bits[i] = bits[i] & ~v.bits[i]; 292 return result; 293 } 294 295 private SimpleBitVector orc1(SimpleBitVector v, SimpleBitVector result) 296 { 297 if (result == null) 298 result = new SimpleBitVector(capacity); 299 for (int i = bits.length; i > 0;) 300 result.bits[i] = ~bits[i]  v.bits[i]; 301 return result; 302 } 303 304 private SimpleBitVector orc2(SimpleBitVector v, SimpleBitVector result) 305 { 306 if (result == null) 307 result = new SimpleBitVector(capacity); 308 for (int i = bits.length; i > 0;) 309 result.bits[i] = bits[i]  ~v.bits[i]; 256 310 return result; 257 311 } … … 301 355 }; 302 356 357 // ### %simplebitvectorbiteqv 358 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_EQV = 359 new Primitive("%simplebitvectorbiteqv", PACKAGE_SYS, false, 360 "bitvector1 bitvector2 resultbitvector") 361 { 362 public LispObject execute(LispObject first, LispObject second, 363 LispObject third) 364 throws ConditionThrowable 365 { 366 return ((SimpleBitVector)first).eqv((SimpleBitVector)second, 367 (SimpleBitVector)third); 368 } 369 }; 370 303 371 // ### %simplebitvectorbitnand 304 372 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_NAND = … … 314 382 } 315 383 }; 384 385 // ### %simplebitvectorbitnor 386 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_NOR = 387 new Primitive("%simplebitvectorbitnor", PACKAGE_SYS, false, 388 "bitvector1 bitvector2 resultbitvector") 389 { 390 public LispObject execute(LispObject first, LispObject second, 391 LispObject third) 392 throws ConditionThrowable 393 { 394 return ((SimpleBitVector)first).nor((SimpleBitVector)second, 395 (SimpleBitVector)third); 396 } 397 }; 398 399 // ### %simplebitvectorbitandc1 400 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_ANDC1 = 401 new Primitive("%simplebitvectorbitandc1", PACKAGE_SYS, false, 402 "bitvector1 bitvector2 resultbitvector") 403 { 404 public LispObject execute(LispObject first, LispObject second, 405 LispObject third) 406 throws ConditionThrowable 407 { 408 return ((SimpleBitVector)first).andc1((SimpleBitVector)second, 409 (SimpleBitVector)third); 410 } 411 }; 412 413 // ### %simplebitvectorbitandc2 414 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_ANDC2 = 415 new Primitive("%simplebitvectorbitandc2", PACKAGE_SYS, false, 416 "bitvector1 bitvector2 resultbitvector") 417 { 418 public LispObject execute(LispObject first, LispObject second, 419 LispObject third) 420 throws ConditionThrowable 421 { 422 return ((SimpleBitVector)first).andc2((SimpleBitVector)second, 423 (SimpleBitVector)third); 424 } 425 }; 426 427 428 // ### %simplebitvectorbitorc1 429 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_ORC1 = 430 new Primitive("%simplebitvectorbitorc1", PACKAGE_SYS, false, 431 "bitvector1 bitvector2 resultbitvector") 432 { 433 public LispObject execute(LispObject first, LispObject second, 434 LispObject third) 435 throws ConditionThrowable 436 { 437 return ((SimpleBitVector)first).orc1((SimpleBitVector)second, 438 (SimpleBitVector)third); 439 } 440 }; 441 442 // ### %simplebitvectorbitorc2 443 private static final Primitive _SIMPLE_BIT_VECTOR_BIT_ORC2 = 444 new Primitive("%simplebitvectorbitorc2", PACKAGE_SYS, false, 445 "bitvector1 bitvector2 resultbitvector") 446 { 447 public LispObject execute(LispObject first, LispObject second, 448 LispObject third) 449 throws ConditionThrowable 450 { 451 return ((SimpleBitVector)first).orc2((SimpleBitVector)second, 452 (SimpleBitVector)third); 453 } 454 }; 316 455 }
Note: See TracChangeset
for help on using the changeset viewer.