[jira] [Updated] (LUCENE-3448) Add FixedBitSet.and(other/DISI), andNot(other/DISI)

2011-11-21 Thread Uwe Schindler (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/LUCENE-3448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uwe Schindler updated LUCENE-3448:
--

Attachment: LUCENE-3448-fix-optimization.patch

This patch fixes the optimized OpenBitSetIterator and/or/andNot methods to 
correctly exhaust the iterator after applying the underlying bits.

 Add FixedBitSet.and(other/DISI), andNot(other/DISI)
 ---

 Key: LUCENE-3448
 URL: https://issues.apache.org/jira/browse/LUCENE-3448
 Project: Lucene - Java
  Issue Type: Sub-task
  Components: core/other
Affects Versions: 3.4, 4.0
Reporter: Uwe Schindler
Assignee: Uwe Schindler
 Fix For: 3.5, 4.0

 Attachments: LUCENE-3448-fix-optimization.patch, LUCENE-3448.patch, 
 LUCENE-3448.patch


 For the parent issue, and() and andNot() on DISIs and other FixedBitSets are 
 missing. This issue will add those methods.
 The DISI methods (also the already existing or(DISI)) method will check for 
 OpenBitSetIterator and do an inplace operation using the bits as optimization.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (LUCENE-3448) Add FixedBitSet.and(other/DISI), andNot(other/DISI)

2011-09-22 Thread Uwe Schindler (JIRA)

 [ 
https://issues.apache.org/jira/browse/LUCENE-3448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uwe Schindler updated LUCENE-3448:
--

Attachment: LUCENE-3448.patch

Patch.

One thing I don't like with FixedBitSet (makes code ugly and slows down for 
some special cases in prevSetBit):

The usage pattern for nextSetBit/prevSetBit is the following:

{code:java}
for(int i=bs.nextSetBit(0); i=0; i=bs.nextSetBit(i+1)) {
 // operate on index i here
}
{code}

The problem is that the i+1 at the end can be bs.length(), but the code in 
nextSetBit does not allow this (same applies to prevSetBit(0)). The above usage 
pattern is in every programming book, so it should really be supported. The 
check has to be done in all cases (with the current impl in the calling code).

If the check is done inside xxxSetBit() it can also be optimized to be only 
called seldom and not all the time, like in the ugly looking replacement, thats 
currently needed:

{code:java}
for(int i=bs.nextSetBit(0); i=0; i=(ibs.length()-1) ? bs.nextSetBit(i+1) : 
-1) {
 // operate on index i here
}
{code}

We should change this and allow out-of bounds indexes for those two methods 
(they already do some checks in that direction). Enforcing this with an assert 
is unuseable on the client side.

The test code for FixedBitSet also uses this, horrible. Please support the 
common usage pattern for BitSets.

 Add FixedBitSet.and(other/DISI), andNot(other/DISI)
 ---

 Key: LUCENE-3448
 URL: https://issues.apache.org/jira/browse/LUCENE-3448
 Project: Lucene - Java
  Issue Type: Sub-task
  Components: core/other
Affects Versions: 3.4, 4.0
Reporter: Uwe Schindler
Assignee: Uwe Schindler
 Fix For: 3.5, 4.0

 Attachments: LUCENE-3448.patch


 For the parent issue, and() and andNot() on DISIs and other FixedBitSets are 
 missing. This issue will add those methods.
 The DISI methods (also the already existing or(DISI)) method will check for 
 OpenBitSetIterator and do an inplace operation using the bits as optimization.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (LUCENE-3448) Add FixedBitSet.and(other/DISI), andNot(other/DISI)

2011-09-22 Thread Uwe Schindler (JIRA)

 [ 
https://issues.apache.org/jira/browse/LUCENE-3448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uwe Schindler updated LUCENE-3448:
--

Attachment: LUCENE-3448.patch

Updated patch, some improvements. Also limit DISI to numBits

 Add FixedBitSet.and(other/DISI), andNot(other/DISI)
 ---

 Key: LUCENE-3448
 URL: https://issues.apache.org/jira/browse/LUCENE-3448
 Project: Lucene - Java
  Issue Type: Sub-task
  Components: core/other
Affects Versions: 3.4, 4.0
Reporter: Uwe Schindler
Assignee: Uwe Schindler
 Fix For: 3.5, 4.0

 Attachments: LUCENE-3448.patch, LUCENE-3448.patch


 For the parent issue, and() and andNot() on DISIs and other FixedBitSets are 
 missing. This issue will add those methods.
 The DISI methods (also the already existing or(DISI)) method will check for 
 OpenBitSetIterator and do an inplace operation using the bits as optimization.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org